Forums › Forums › Search & Filter Pro › Using SFP and Custom Post types
- This topic has 2 replies, 2 voices, and was last updated 10 years, 9 months ago by
Anonymous.
-
Anonymous(Private) January 12, 2016 at 2:10 pm #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(Private) January 13, 2016 at 11:34 am #34110Hey 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_postdataafter your loops where necessaryAlso, 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
-
AuthorPosts