Winning Agent

Sales That Work

  • About
  • Store
  • Blog
  • The Stream
  • Forum
  • Jobs

Changing text displayed for an empty search result

Home › Forums › Winning Agent Pro Theme › Changing text displayed for an empty search result

Tagged: php, Search

  • This topic has 3 replies, 2 voices, and was last updated 7 years, 5 months ago by Ginger Coolidge.
Viewing 3 reply threads
  • Author
    Posts
    • January 8, 2015 at 11:43 am #4181
      barbarad
      Participant

      HI,

      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
      Participant

      Hi 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
      Participant

      Hi,

      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
      Participant

      Hi 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.

      Genesis – How to Change Text Shown When No Posts Are Found


  • Author
    Posts
Viewing 3 reply threads
  • You must be logged in to reply to this topic.
Log In

Forum Login

Log In
Register Lost Password

Search Forums

StudioPress Real Estate WordPress Theme: Agent Focused Pro Theme
StudioPress Premium WordPress Themes: Winning Agent Pro Theme

Recent Replies

  • How to edit main page background image opacity
  • Fresh Install Issues
  • Remove Background Image
  • Sidebar on Homepage
  • Featured Page on Homepage Not Clickable
OptinMonster

Loan Types & Property Definitions

There are a lot of different types of mortgages, and there are a lot of different types of real estate property. Here is a list of the most common types of each. We’ve added some links to the most popular articles on the subject.

Read More

Real Estate and Mortgage Forum

We think getting many viewpoints to a particular question is important because it helps you to make better decisions. It’s so important that we have woven the Forum all throughout Winning Agent. We invite you to ask questions, make comments, and be part of the discussion.

Read More

Glossary of Real Estate Terms

Real estate and mortgage finance often times comes with its own unique language. If you work with it every day, it becomes 2nd nature, but most people don’t work with it every day. So we’ve created a glossary of mortgage and real estate terms.

Read More

Copyright © 2022 Winning Agent · Powered by the Genesis Framework · Contact Us
Become an Affiliate
This site uses affiliate links, but know that we only recommend products we personally use and enjoy!