Forums Forums Search & Filter Pro "As an Archive" Not displaying results

Viewing 6 posts - 1 through 6 (of 6 total)
  • Anonymous
    #34312

    Hey Folks,

    I’ve successfully installed and am using Search and Filter pro. The Shortcode results are showing up perfectly, but I can’t get the “Archive” results to display and I don’t know why.

    I’ve double checked the settings and rebuilt the cache to no avail. On the staging site I’ve used normal search with results, but for some reason this form isn’t returning anything.

    Settings are:
    General:
    Posts, 50pp, Auto submit, AND
    Display Results:
    As an archive
    Use custom template
    search.php (which exists in my theme)
    Load results using Ajax
    Posts:
    Published
    Tags, Cats and Tax:
    Categories – Include: 5

    Live site: http://hudsonheritage.org/brewster-mansion/
    Search “Hudson” in the search field on the bottom right hand side.

    Thanks in advance for all your help,
    Adam

    Ross Moderator
    #34326

    Hey Adam

    This is likely either to do with the setup of the search template or some other plugins/custom code interfering with the search results and the search query.

    The shortcode method is usually more reliable because 3rd party code is less likely to modify those queries, however archive is susceptible to being hijacked because it uses the main WP loop.

    Do you see any custom queries on your template? IE – WP_Query, get_posts or query_posts

    These are all tell tale signs of overwriting the main WP query, and in effect overwriting the the search results.

    Thanks

    Anonymous
    #34840

    Unfortunately I wasn’t able to identify the error. I turned off all the other plugins and I used the basic search.php from the WP TwentyFifteen, but still no results.

    I ended up using the basic WP search with a category limitation as demonstrated here: http://www.wpexplorer.com/limit-wordpress-search/

    Thanks for the help!
    Adam

    Ross Moderator
    #34900

    🙂

    Anonymous
    #36622

    I finally solved this.

    I had a function that excluded a category from the main loop, and it was breaking S&FP.

    // Exclude properties from the main loop
    function exclude_category( $query ) {
        if ( $query->is_home() && $query->is_main_query() ) {
            $query->set( 'cat', '-5' );
        }
    }
    add_action( 'pre_get_posts', 'exclude_category' );
    Ross Moderator
    #36639

    Glad to hear and thanks for the update.

Viewing 6 posts - 1 through 6 (of 6 total)