WordPress.org

Ready to get started?Download WordPress

Forums

Search Engine
Tip: Remove blog name from search-engine results (2 posts)

  1. Starbuck
    Member
    Posted 3 years ago #

    The search-engine v0.5.7.1 plugin of course displays the title of each blog entry along with a summary of the content. If the index only contains one blog, it's redundant and annoying to see the blog name in every title. For example:
    My trip by TravlerBlog
    Fun in a new town by TravlerBlog
    Packing tips by TravlerBlog

    To eliminate the " by TravlerBlog" text (made up name for this example), I replaced line 1235 of search-engine.php with the following (line split for readability but this is all one line):

    <h3 class="search_engine_Title">
      <a href="<?php echo $result->url; ?>">
       <?php echo $search->search_do_excerpt(
      str_replace('&nbsp;by&nbsp;TravlerBlog', '',$result->title)
      ,68,false);
       ?>
      </a>
    </h3>

    The 'str_replace()' part replaces the original full $result->title.

    If there is a better way to do this, please post here. Thanks!

    HTH

  2. Scott Kingsley Clark
    Member
    Plugin Author

    Posted 3 years ago #

    I've got a feature on my roadmap for the plugin for a filter on the page titles, so that it can remove the text "by TravlerBlog" from every title on indexing.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic