Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #17738

    Hi, I’m trying to get my post items to display random order every time it loads up. I’ve seen other threads here which links to: but that is only good if you want total control- however I don’t want to spend time sorting, just let it generate randomly. tried a couple of plugins.. but they didn’t work.

    I believe its a: ‘orderby’ => ‘rand’ but I can’t figure out where to put it.


    Open up template-blog.php and replace:

    $avia_config['new_query'] = array( "paged" => get_query_var( 'paged' ), "posts_per_page"=>get_option('posts_per_page') ) ;


    $avia_config['new_query'] = array( "paged" => get_query_var( 'paged' ), "orderby" => "rand", "posts_per_page"=>get_option('posts_per_page') ) ;


    thanks. It worked for the blog page… but I was hoping for the portfolio page.

    I tried copying the code into template-portfolio.php…. but didn’t work :(


    Open up includes/loop-portfolio.php and replace:

    if(isset($avia_config['new_query'])) { query_posts($avia_config['new_query']); }


    if(isset($avia_config['new_query'])) {
    $avia_config['new_query']['orderby'] = "rand";


    thank you.

    great support once again. I will buy more themes from you guys in future projects because of the after sales support!



    Glad that I could help you :)

    Best regards,



    just one thing. when I have more than 1 page in the portfolio the page loads randomly which is what I want.

    When I go to page 2, it also loads randomly but seems to also load images that has been in page 1. Is there any way to let it remember what it has displayed in the 1st page so it dos’nt repeat in the 2nd page?



    No, unfortunately this is not easily possible…



Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘post item random order’ is closed to new replies.