Home › Forums › Winning Agent Pro Theme › Changing text displayed for an empty search result
- This topic has 3 replies, 2 voices, and was last updated 7 years, 5 months ago by
Ginger Coolidge.
- AuthorPosts
- January 8, 2015 at 11:43 am #4181
barbarad
ParticipantHI,
We would like to change posts.php
genesis_noposts_text for
function genesis_do_noposts() {‘Sorry, no content matched your criteria.’
on line 386 of post.php
to
‘It looks like we don’t have a property that matches your exact criteria at this time. But don’t worry! Contact us at 716.381.5791 or Mike@nywoodlands.com. We can help you find what you are looking for.’
I edited a copy of post.php and placed it in themes/winning-agent/lib/structure/. It doesn’t seem to have worked. Any advice?
Thanks!
- January 9, 2015 at 6:17 pm #4201
Ginger Coolidge
ParticipantHi there,
I sounds like you made a copy of your file so I won’t give you hard time about editing your core Genesis Framework files. That said, if you’re trying to edit the search results page that comes after using the AgentPress Listings plugin, have a look a this tutorial that will show you how to create a new listings template and then you can add whatever text you would like:
AgentPress Listings Search Results changed after WordPress 4.0 Update
Hope this works out!
-Ginger
- January 11, 2015 at 1:22 pm #4253
barbarad
ParticipantHi,
This did get rid of the “Search results for” box, which is great, thanks.
And, I know it may be beyond what you support, but this is what I placed in archive-listing.php and it didn’t change the “Sorry, no results match your criteria.” text.
Any input would be great, or can you point me in the direction of some documentation?
Thanks!
<?php /** * This file adds an AgentPress Listings custom post type archive template to the Winning Agent Pro Theme. * * @author Ginger Coolidge * @package Winning Agent Pro * @subpackage Customizations */ add_action( 'genesis_loop_else', 'genesis_do_noposts' ); /** * Echo filterable content when there are no posts to show. * * The applied filter is <code>genesis_noposts_text</code>. * * @since 1.1.0 */ function genesis_do_noposts() { printf( '<div class="entry"><p>%s</p></div>', apply_filters( 'genesis_noposts_text', __( 'It looks like we don’t have a property that matches your exact criteria at this time. But don’t worry! Contact us at 716.381.5791 or Mike@nywoodlands.com. We can help you find what you are looking for.', 'genesis' ) ) ); } } genesis();
- January 11, 2015 at 4:29 pm #4262
Ginger Coolidge
ParticipantHi there,
I’m glad you asked, this was a good idea. I don’t think you need that action, but rather just a filter. I tested this on my archive-listing.php and it worked. Add this before the loop call:
/** Change Text Shown When No Posts Are Found */ add_filter('genesis_noposts_text', 'eo_noposts_text'); function eo_noposts_text($text) { $text = '<span class="noposts-text">' . __('Your request did not return any results, please check back later.', 'eo') . '</span>'; return $text; }
And of course change the ‘Your request did not return any results, please check back later.’ to your text. I searched and copied from this post, also talks about styling the outcome too.
- AuthorPosts
- You must be logged in to reply to this topic.