Not filtering custom post content

Forums › Forums › Search & Filter Pro › Not filtering custom post content

Viewing 10 posts – 1 through 10 (of 12 total)
  • Anonymous
    #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
    #2355

    Hey 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 🙂

    Anonymous
    #2358
    This reply has been marked as private.
    Ross Moderator
    #2359
    This reply has been marked as private.
    Anonymous
    #2416
    This reply has been marked as private.
    Anonymous
    #2417
    This reply has been marked as private.
    Ross Moderator
    #2462

    Hey 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

    Anonymous
    #2921
    This reply has been marked as private.
    Ross Moderator
    #2985

    Hey Jay, logging in tonight to see what can be done 😉

    Ross Moderator
    #3104

    Hey 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/ to rushingwind.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?

Viewing 10 posts – 1 through 10 (of 12 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.