Forums Forums Search & Filter Pro Filter for custom post has stopped working

Viewing 10 posts - 1 through 10 (of 20 total)
  • Anonymous
    #240586

    Hello

    I’ve been using Search and Filter Pro for several years but have a come across an issue on one website that I’ve never had before.

    There is a filter set up for a custom post using the ‘Custom’ option, which was working fine. I then added a different filter for WooCommerce products on the same website, which also worked.

    However, since adding the filter for the Woocommerce products, the filter for the custom post types are not displaying, but the drop-down categories are showing the correct count within the taxonomy (i.e. not zero). When a category is selected no results are displayed. When I add other content to this filter (e.g. WooCommerce products), this content shows, but still not the custom post type.

    I’ve been into the custom posts and re-saved them, but still no luck. The custom post settings haven’t changed. Unfortunately, when I remove the filter WooCommerce products, the custom post filter still doesn’t work.

    Any help would be appreciated.

    Plugin version: 2.5.0

    Thank you!

    Trevor
    #240620

    If the other filter is disabled, does it then work? I suspect that some use is being made of the pre_get_posts() function, which overrides our filter arguments (hence the counts would work, but the actual submit would not).

    Anonymous
    #240707

    Hi Trevor – thanks for the response.

    If the WooCommerce product filter is disabled the original filter still doesn’t work. Neither can I find pre_get_posts being used. I’m using WooCommerce Memberships, so perhaps that’s the issue, but it’s strange that it’s only just stopped working.

    I’ve tried using the recommended Custom code (see below), but still none of the custom post types are displayed:

    $args = array(‘post_type’ => ‘resources’);
    $args[‘search_filter_id’] = 21588;
    $query = new WP_Query($args);

    I’ve also created a new form to see if that would work, with no success.

    Thanks

    Trevor
    #240798

    Are you able to send me a live link/URL to your search page so I can take a look?

    Can you tell me (if you remember) why we/you used the custom method instead of the WooCommerce shop method?

    Anonymous
    #240925

    Will get the Staging site set up.

    Re. your question: the first filter was filtering custom posts so I used the ‘Custom’ option. The second filter I created was for a WooCommerce ‘shop’ page, where I used the ‘WooCommerce Shop’ method. After creating this filter, the one for the custom posts stopped working.

    Anonymous
    #240937
    This reply has been marked as private.
    Trevor
    #240951
    This reply has been marked as private.
    Anonymous
    #241026
    This reply has been marked as private.
    Trevor
    #241056

    So, the WC form stops the custom one from working? Which PHP template file was this code in:

    $args = array('post_type' => 'resources');
    $args['search_filter_id'] = 21588;
    $query = new WP_Query($args);
    Anonymous
    #241665
    This reply has been marked as private.
Viewing 10 posts - 1 through 10 (of 20 total)