• Sakthivel

    (@saravanankanagaraj)


    Created an loop template(custom skin) and referred it in archive template called post type category. Am using post widget.

    I can able to list all my post. While i navigate through pagination, sorting of posts looks collapsed. for ex. post which ever in 1st page appears in 3rd page & vice versa.

    I have provided the query properly to order it in ascending.

    Elementor Version: 2.8.5
    Elementor Pro Version: 2.8.3
    Elementor Custom Skin Version:1.3.10
    Wordpress version : 5.3.2

    • This topic was modified 4 years, 9 months ago by Sakthivel.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author dudaster

    (@dudaster)

    If you select classic skin is it workin properly?

    Thread Starter Sakthivel

    (@saravanankanagaraj)

    No i have checked on by selecting different skin. But now it’s working. the actual problem is while hook the per_get_posts method in search page i was written below code that was the problem.
    Old code:
    function searchsorting($query) {
    if ( $query->is_search&& !is_admin() ) {
    $query->set(‘post_type’,array(‘sfwd-courses’,’sfwd-lessons’,’sfwd-topic’));
    $query->set(‘orderby’, ‘post_type’ );
    $query->set(‘order’, ‘ASC’ );
    }
    return $query;
    }
    add_filter(‘pre_get_posts’,’searchsorting’);

    New Code:
    function searchsorting($query) {
    if (is_search()&& !is_admin() ) {
    $query->set(‘post_type’,array(‘sfwd-courses’,’sfwd-lessons’,’sfwd-topic’));
    $query->set(‘orderby’, ‘post_type’ );
    $query->set(‘order’, ‘ASC’ );
    }
    return $query;
    }
    add_filter(‘pre_get_posts’,’searchsorting’);

    Thanks for the reply!

    • This reply was modified 4 years, 9 months ago by Sakthivel.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Sorting order is not proper on Pagination’ is closed to new replies.