Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #621

    Hi Kriesi,

    Thanks for this great theme

    I would like the option to shuffle random posts in the gallery post (instead of displaying the most recent posts).

    In Display theme support you recommended edit the query string add orderby=RAND in kclass_display_box.php but I don’t know where.

    Thanks,

    Peter

    #32224

    Hey,

    For Expose, the setup of the query_string is slightly different and is in index.php not kclass_display_box.php.

    On line 14 of index.php, you should find this code:

    $additional_loop = new WP_Query("paged=$paged&cat=".$k_option['gallery']['gallery_cat_final']."&posts_per_page=".$k_option['gallery']['post_count']);

    You need to add orderby=RAND here like this:

    $additional_loop = new WP_Query("paged=$paged&cat=".$k_option['gallery']['gallery_cat_final']."&posts_per_page=".$k_option['gallery']['post_count']."&orderby=RAND");

    James

    #32225

    No work, I tested a clean install, without modification (except this modificaton “&orderby=RAND”) and it works just as without orderby=RAND

    #32226

    I solved the problem,”RAND” should be lowercase, not uppercase:

    $additional_loop = new WP_Query(“paged=$paged&cat=”.$k_option.”&posts_per_page=”.$k_option.”&orderby=rand”);

    Thanks

    #32227

    Hey!

    Sorry, you’re right – it should be lowercase.

    Some variables need to be uppercase / some need to be lowercase. I get them mixed up sometimes. :)

    Best regards,

    James

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

The topic ‘Random Post in Gallery’ is closed to new replies.