• Resolved johndoe01

    (@johndoe01)


    Greetings.
    I’m having a problem. The Sorting Filter (Which appears as publish date,etc)

    I have made a customization on the list page (list.php) and hid the search form fields (which are now on header). The problem is that i do the sorting and it is not working.

    Since i’ve made several edits on the file i show it to you on this link
    https://pastebin.com/T9KudKX7

    I’m really lost on where to begin to edit to fix it.
    Thanks in Advance and sorry for the questions of the same site over and over.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    What params are you using for the [adverts_list] shortcode which shows the Ads? If it does not have the allow_sorting param set to 1 it will not sort items even if there is adverts_sort param in the URL.

    Thread Starter johndoe01

    (@johndoe01)

    Here lies the problem. Is the Category list generated by the plugin itself (to clarify, this is not from a page using the short code, the page is an advert category generated under the menu). As seen on this screenshot (note the lower left corner)

    View post on imgur.com

    Despite i have few pages with this the shortcode, majority of them are categories generated by the plugin and suffer from this issue. (At the moment of writing i haven´t tested the shortcode ones)

    Thread Starter johndoe01

    (@johndoe01)

    I disabled the custom list page to troubleshoot. But the adverts page has the parameter

    View post on imgur.com

    And with the default list now does not appear.

    Thread Starter johndoe01

    (@johndoe01)

    Missed the other screenshot https://i.imgur.com/ufOrHk9.png

    Thread Starter johndoe01

    (@johndoe01)

    Found the culprit:

    is plausible that in an earlier implementation i set in the documentation these lines in functions.php

    add_action("init", "my_theme_wpadverts_init", 20);
    function my_theme_wpadverts_init() {
        remove_filter('template_include', 'adverts_template_include');
    }

    Once i disabled them. Voila. The filter works

    EDIT: Too Early to Celebrate:

    Adverts works but the Categories doesn’t work still even with the fixing. I guess i have to do the taxonomy page again.

    • This reply was modified 5 years, 10 months ago by johndoe01.
    Thread Starter johndoe01

    (@johndoe01)

    FINALLY!

    Indeed i had to do the taxonomy page as stated in the Child Themes documentation but the inner part i had to set it like this:

    <?php if ( have_posts() )  {
            global $wp_query;
        remove_filter("the_content", "adverts_the_content");
        echo shortcode_adverts_list(array(
            "category" => $wp_query->get_queried_object_id(),
            'allow_sorting' => 1,
         ));
        
    } ?>

    That allow sorting was that.
    Now this is Completely SOLVED.

    Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    ok great, i am glad you have it resolved and thanks for the detailed feedback, maybe someone in the future will find it helpful as well.

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

The topic ‘Category Sorting not working’ is closed to new replies.