Using SFP and Custom Post types

Forums › Forums › Search & Filter Pro › Using SFP and Custom Post types

Viewing 3 posts – 1 through 3 (of 3 total)
  • Anonymous
    #34012

    Hi there,

    I just started using SFP and I’m having some problems with this plug-in.
    I made my own custom theme with a modified loop and custom post types.

    This means my loop starts with:
    <?php $loop = new WP_Query( array( ‘post_type’ => ‘CPT_Name’, ‘posts_per_page’ => -1, ‘orderby’ => ‘date’, ‘order’ => ‘ASC’, ‘paged’ => $paged) ); ?>

    In my loop there are more than one, this repeats about six times. This way I’m able to show all my CPT in the index.php.

    But the SFP plug-in doesn’t work like this. I have used THE LOOP and then it kind of works. Only when I select a CPT it shows the posts. But there are now CPT’s show on the index.php when i open it.

    Can you please help me with my issue.

    TIA.

    Ross Moderator
    #34110

    Hey Edward

    I’m finding it hard to see what you are trying to do if you could explain further that would help?

    You should have no issues having multiple queries on the same page but I hope you are running a https://codex.wordpress.org/Function_Reference/wp_reset_postdata after your loops where necessary

    Also, if you are using S&F in archive mode, then the it uses teh main loop, not a custom query like above.

    Try to remove all custom queries from your template for S&F and see if ti works?

    This will at least point us in the right direction.

    Thanks

    Anonymous
    #34118

    Hey Ross,

    I have solved this problem using THE loop the wp codex provides.

    Thanks for the reply.

Viewing 3 posts – 1 through 3 (of 3 total)

Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.