WordPress.org

Ready to get started?Download WordPress

Forums

Search Everything
Highlight tags & Categories (3 posts)

  1. billseymour
    Member
    Posted 3 years ago #

    Just started using Search Everything v6.6, works just fine- thanks!

    I have a few requests to expand highlighting:
    - highlight tags containing search term(s)
    - highlight categories containing search terms(s)

    - also: is there a way to display a post excerpt that contains the searched-for term? When testing the plugin, I realized that the_excerpt may not contain the searched-for term (which might appear elsewhere in the post.

    Great work. --Bill

    http://wordpress.org/extend/plugins/search-everything/

  2. TTH247
    Member
    Posted 3 years ago #

    I know that this response is late, but for posterity here's how to highlight tags:

    1. With your favoured text-editor, open the search-everything.php file that is in your /wp-content/plugins directory/folder.
    2. Go to line 140 (note I'm using version 6.6 of the plugin) and below it, insert the following line of code:
      add_filter('the_tags', array(&$this,'se_postfilter'), 11);

    The code block from lines 135-142 (again I'm using version 6.6 of the plugin) should now resemble the below sample:

    // Highlight content
    if("Yes" == $this->options['se_use_highlight']) {
         add_filter('the_content', array(&$this,'se_postfilter'), 11);
         add_filter('the_title', array(&$this,'se_postfilter'), 11);
         add_filter('the_excerpt', array(&$this,'se_postfilter'), 11);
         add_filter('the_tags', array(&$this,'se_postfilter'), 11);
    }
  3. mark7694
    Member
    Posted 3 years ago #

    What would I need to do in order for it to search taxonomy terms? Currently I output a list of terms into my results based on how they were classified. For example, they are outputted on my post like this:

    <?php echo get_the_term_list( $post->ID, 'topic-area',) ?>
    <?php echo get_the_term_list( $post->ID, 'activity', ) ?>
    <?php echo get_the_term_list( $post->ID, 'population-type' ) ?>

    I've tried:

    add_filter('the_term_lists', array(&$this,'se_postfilter'), 11);

    but that doesn't work.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic