Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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:

    http://www.kriesi.at/support/topic/default-product-sort-order 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.

    #96640

    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') ) ;

    with:

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

    #96641

    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 :(

    #96642

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

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

    with:

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

    #96643

    thank you.

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

    #96644

    Hey!

    Glad that I could help you :)

    Best regards,

    Peter

    #96645

    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?

    #96646

    Hey!

    No, unfortunately this is not easily possible…

    Regards,

    Peter

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

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