Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #203768

    Hi!!

    I am using the Post Slider in my home page: http://www.adw.cl

    But the order of the post is allways the same (date of upload).

    I want the order to be random, so the Home page looks diferent every time you load it.

    I have seen some topics in the forum, but not sure how to do it in Enfold.

    Please help!!

    Thanks
    José

    #203770

    Hey jmaguirrei!

    Insert following code at the very bottom of enfold/functions.php – it will change the orderby query parameter to “random” if the post slider is used on the home/front page.

    
    add_filter('avia_post_slide_query','avia_order_by_random', 10, 2);
    function avia_order_by_random($query, $params)
    {
    if(is_home() || is_front_page()) $query['orderby'] = 'rand';
    return $query;
    }
    

    Cheers!
    Peter

    #203774

    Thanks very much Dude, works OK!

    Regards
    José

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Random Post Slider Content Element’ is closed to new replies.