Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
283 views
in Q2A Core by
How can Rotating question in front page? any idea?
by
What exactly do you mean by a "rotating question"?
by
when refresh the page or visitor come to page each times to show difference post in top of questions.

1 Answer

+1 vote
by
To randomize the question order you can insert this code in qa-page-home.php:

function random_comparison($a, $b)
{
    return rand(-1, 1);
}

uasort($questions, 'random_comparison');

Insert it after this:

if (isset($pagesize))
    $questions=array_slice($questions, 0, $pagesize);
by
Yes, it is work well. Thank you

Welcome to the Q&A site for Question2Answer.

If you have a question about Q2A, please ask here, in English.

To report a bug, please create a new issue on Github or ask a question here with the bug tag.

If you just want to try Q2A, please use the demo site.

April 20, 2021: Q2A 1.8.6 released!

Categories

...