Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #652589

    Hello Sir / Madam,

    I have a question. I’m using both post slider and blog post page so that I can show some posts on the bottom side of a post and all the posts on a separate blog post page.

    I wanted to do random order on the post slider. So, I googled and put below code in function.php

    add_filter(‘avia_post_slide_query’, ‘my_avia_post_slide_query’, 10, 2);

    function my_avia_post_slide_query($query, $params)
    {
    $query[‘orderby’] = ‘rand’;
    return $query;
    }

    It works perfectly fine. But, this code changed the order of the blog post page as well. I would like to do random order on post slider but, written time base order on blog post page (using Blog Posts from Content Elements). Would you please provide codes for this request ?

    Thanks & Regards,

    #653804

    Hey Keetaek_Han,

    you could try to include WordPress’ is_page function into the code you’ve mentioned: https://developer.wordpress.org/reference/functions/is_page/

    Best regards,
    Andy

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.