So, you’re rocking along on your Winning Agent Pro or other Genesis child-themed web site, proud of yourself that you’ve kept everything up to date. Recently though, you have noticed something different — now when you use your AgentPress Listings search the output has a large shaded box at the top with the bolded letters “Search Results for:” You don’t recall this being there before; what happened? Well, I noticed it too and began my search with two questions:
1. What happened?
2. How do I fix it?
So, what happened?
Apparently, there were some WordPress core changes to wp_query after the latest WordPress 4.0 “Benny” update. Now I do not pretend to know all the inner-workings of wp_query, other than to know it’s the main engine that powers “the loop”, or the query string the code uses, that retrieves your posts to be displayed. After retrieving the posts, then WordPress decides which template will be used to display the page output. On the previous link you can read in detail about how templates are chosen if you desire, but the bottom line is unless your theme or another plugin supplies an archive-listings template for the listings custom post type, you are now defaulting to search.php in the Genesis core framework. This template includes the display of the shaded box “Search Results for:” at the top of the page. OK, mystery solved!
So, how do I fix it?
The solution is two fold: First, make sure you get the latest version (minimum version 1.2.2) of the AgentPress Listings plugin. Second, create an archive-listings template for your site to find and use instead of letting it default to search.php.
There was a little hiccup when version 1.2.2 of AgentPress Listings was released, so you wouldn’t have received an update notification on your Dashboard. To correct, you can delete the existing version, if it’s older, and replace it with the updated one – you won’t lose any of your listings.
This is easier than you think. Although, one cautionary note: If you’ve never edited or added a file to your site before, I recommend reading this post for some tips: Editing Your WordPress Site 101.
Let’s get started. Using a text editor, create a new file and copy/paste the following to your file:
Save the file with the exact filename:
Last step is to connect to your site via FTP and navigate to your wp-content/themes folder and to the folder of your active theme. Drop your shiny new file in the folder of your active theme. That’s it! Go to your site, search on your AgentPress Listings search widget, and now the shaded box should be gone.
Leave a Reply