Home Forums Weaver Show Posts & Show Sliders change “no posts found” for Show Posts

Topic Resolution: Resolved
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #71728
    hosh
    Participant

    How would I change the unattractive message “no posts found” for when the Show Posts widget lacks results to something more attractive like “Watch this space!”

    thanks.

    #71729
    scrambler
    Moderator

    @weaver would be the best one to answer that one.

    #71746
    Weaver
    Keymaster

    It is easy to do if you understand a bit about how WordPress works.

    The basic answer is that the message is sent through a filter which can be used to add whatever text you want. It is called by the ShowPosts plugin like this:

    echo apply_filters( 'wvr_show_posts_no_posts', 'No posts found.');
    


    So you need to add a filter to your theme that returns the wording you need. The standard way to do this is with a child theme.
    You would add code like this to the child functions.php file:

     

    add_filter('wvr_show_posts_no_posts', 'weaverx_no_posts_message');
    
    function weaverx_no_posts_message($old_message)
    {
      return 'Watch this space!';
    }
    

    If you have Weaver Xtreme Plus, you can add that code to the Actions and Filters section of the Site <HEAD> Section option.

    #71773
    hosh
    Participant

    Thanks!  That solves it. With Weaver Xtreme Plus, In Customize |  Options Level “Full”,  Interface “What” | Added Content (HTML Areas… | Site HEAD Section |  Actions & Filters  : added the code mentioned.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.