Forums › Forums › Search & Filter Pro › "As an Archive" Not displaying results
Tagged: broken form, No results
- This topic has 5 replies, 2 voices, and was last updated 8 years, 9 months ago by Ross.
-
Anonymous(Private) January 14, 2016 at 11:46 pm #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: 5Live 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,
AdamRoss Moderator(Private) January 15, 2016 at 6:44 am #34326Hey 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
orquery_posts
These are all tell tale signs of overwriting the main WP query, and in effect overwriting the the search results.
Thanks
Anonymous(Private) January 20, 2016 at 6:09 pm #34840Unfortunately 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!
AdamAnonymous(Private) February 10, 2016 at 2:30 am #36622I 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(Private) February 10, 2016 at 12:14 pm #36639Glad to hear and thanks for the update.
-
AuthorPosts