• Resolved Houdini

    (@romariokg)


    Hi,

    I found a problem when sorting in taxiomies! If you select, for example, the city of Dubai, the advertising sorting will change to “Ascending”. This is not correct, first there should be new advertisements added by date in the list.

    How to properly configure sorting on the taxiomies page so that ads appear in the same order as on the general ads page from the main user settings.

    https://prnt.sc/3CLqBuvwnwcg

    • This topic was modified 1 year, 1 month ago by Houdini.
    • This topic was modified 1 year, 1 month ago by Houdini.
    • This topic was modified 1 year, 1 month ago by Houdini.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Houdini

    (@romariokg)

    Hi, I found that sorting when navigating by taxomies rtcl_category and rtcl_location does not work correctly due to the Classified Listing Store 2.0.0 plugin.

    If I disable the Classified Listing Store plugin, sorting starts working normally from the user settings, I did not find the reason for this behavior. I recommend you to check it.

    Thread Starter Houdini

    (@romariokg)

    To solve this problem I had to use the following code in the functions.php file

    ## Force sorting of records (tasks) in descending order (DESC)
    function force_rtcl_listing_order( $query ) {
    if ( ! is_admin() && $query->is_main_query() && (
    // is_post_type_archive( 'rtcl_listing' ) ||
    is_tax( 'rtcl_category' ) ||
    is_tax( 'rtcl_location' ) // Taxonomies rtcl_category and rtcl_location
    )) {
    $query->set( 'orderby', 'date' ); // Can be replaced with 'title', 'meta_value'.
    $query->set( 'order', 'DESC' ); // Force DESC
    }
    }
    add_action( 'pre_get_posts', 'force_rtcl_listing_order' );

    My problem is solved, but it is worth paying attention to.

    Plugin Support Muhammad Ali Akbar

    (@alireyad)

    Hi,
    Thanks for identifying the issue specifically, will fix the conflict with store plugin.

    Thank you

    Plugin Support Muhammad Ali Akbar

    (@alireyad)

    Hi,
    Could you share your settings and search results screenshot?

    I see, it’s okay here and also activated store plugin https://prnt.sc/X81awwlJqFpC https://prnt.sc/dRz34DNpcA6F https://prnt.sc/KHUiXeR6iEzZ

    Thank you

    Thread Starter Houdini

    (@romariokg)

    Hi, I forgot to write to you! It seems to be a code conflict in my theme, because I added my own functions.

    My problem is solved with the code above!

    You can ignore this problem if other users do not write about it.

    I’m sorry! Please forgive me!

    Thanks!

    • This reply was modified 1 year ago by Houdini.
    • This reply was modified 1 year ago by Houdini.
    Plugin Support Muhammad Ali Akbar

    (@alireyad)

    No worries. It’s okay.

    Thank you

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Listing sorting problems to taxiomy’ is closed to new replies.