Forums › Forums › Search & Filter Pro › Not filtering custom post content
- This topic has 11 replies, 2 voices, and was last updated 10 years, 3 months ago by Ross.
-
Anonymous(Private) July 10, 2014 at 2:51 pm #2339
Hello, I downloaded the free version two days ago and I was happy with the filter result that I saw. So from there I decided to purchase the pro version but noticed that the plugin is now filtering my posts anymore.
I am using a my own template page, not index.php and inside this page I have the following post loop for a custom post type called videos.
<?php echo do_shortcode(‘[searchandfilter id=”1586″]’); ?>
<?php $page = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; query_posts(“paged=$page&posts_per_page=16&post_type=videos&post_status=publish”); while ( have_posts() ) : the_post() ?>//Content Goes here//<?php endwhile; ?>
Can you please let me know what I’m doing wrong or maybe I can give you my login information so you can take a look at it.
Thanks!
Ross Moderator(Private) July 10, 2014 at 8:22 pm #2355Hey Jay glad to say this seems to be a straightfoward fix 😉
Basically, in your template you have
query_posts
and then your are displaying the results of this query – so Search & Filter won’t affect the results you see because they are from your own custom query.The way S&F works is to hook in to the main wordpress loop – which is the standard way of displaying posts on a wordpress site – so with a few minor amendments you should be able to get the above code working..
Basically you need to modify this to use the main loop – WP has plenty of details on this and adding it to your template (http://codex.wordpress.org/The_Loop).
I think with your code it would be a simple as removing the query so your code above becomes:
<?php $page = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; while ( have_posts() ) : the_post() ?> //Content Goes here// <?php endwhile; ?>
Let me know 🙂
Ross Moderator(Private) July 14, 2014 at 1:30 pm #2462Hey Jay, do you want to fire over your login details and I’ll take a look? If you can create a new template in your theme folder first that I can use for testing that would be great (just duplicate category.php or the template you mention above and give it a unique name).
Thanks
Ross Moderator(Private) July 28, 2014 at 1:29 pm #2985Hey Jay, logging in tonight to see what can be done 😉
Ross Moderator(Private) August 1, 2014 at 12:23 am #3104Hey Jay, just logged in and quite confusing you’re right!
One thing I noticed is that when you submit the form without Ajax, the page redirects from
rushingwindchurch.ca/
torushingwind.ca/
– when doing Ajax then this will cause a problem for sure as it will be a cross domain request which is generally blocked.I am hoping to do an update on Sunday/Monday that will make setting up Ajax ALOT easier, think you can wait til then?
-
AuthorPosts