Hello, I need help: How can I change the sorting of portfolio items?
I need a random order.
thanks
Flagship Portfolio in random order
6 posts from 3 voices-
Posted 11 months ago #
-
Open up functions.php and add following code to the bottom of the file:
function loop_portfolio_query( $location ) { if ( $location == 'loop-portfolio' ) { global $avia_config; if(isset($avia_config['new_query'])) { $avia_config['new_query']['orderby'] = "rand"; query_posts($avia_config['new_query']); } } } add_action( 'avia_action_query_check' , 'loop_portfolio_query', 10, 1 );Posted 11 months ago # -
Hi Dude, thanks for the function.
I pasted it in the file but every time I load the page (start page with some images from portfolio, or the portfolio page) I get the same pics in the same order.Posted 11 months ago # -
Hello,
The snippet above should work. Try to remove browser histroy then refresh the page. You will notice that the portfolio entries will change order every page load.
Regards,
IsmaelPosted 11 months ago # -
Hello, I deactivated the "post types order"-plugin and now it works.
Supadupa! Thanks for your help.Posted 11 months ago # -
Hi!
Just a hint - the pro version of the post types order plugin allows you to exclude queries with an orderby parameter.
Regards,
PeterPosted 11 months ago #
Reply
You must log in to post.














