• I have installed and activated Relevanssi. However search results do not appear to be using Relevanssi. Results have no highlighting of search term and show complete page(s) instead of extract, with no link(s) to page(s). The site uses the Lovecraft Theme, with the search form in the page footer.
    I use Relevanssi on another site (different theme) and it works very well.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mikko Saari

    (@msaari)

    Those are Relevanssi results, it’s just that the theme is set up to show complete pages instead of excerpts. That’s an odd choice from the theme designer.

    To fix this, you need to edit the content.php file in the theme. Find this:

    <?php the_content(); ?>

    and replace it with this:

    <?php if (is_search()) {
        the_excerpt();
    } else {
        the_content();
    } ?>

    This will show the excerpts as you expect. The search itself works just fine.

    Thread Starter maparle

    (@maparle)

    Mikko, thank you. I now have the required excerpts with search word highlighted. Though link not showing and not formatted as I would expect for search results. It is a pity that Lovecraft does not have a specific searchresults.php file. Regards, Michael

    Plugin Author Mikko Saari

    (@msaari)

    There’s a link in the title, but if you want another link, you can add one by adding this to a suitable spot in the template (for example before the <div class="clear"></div> line):

    <p><a href="<?php the_permalink(); ?>">Read the article &raquo;</a></p>

    The formatting seems standard to me, what specifically are you looking for?

    Thread Starter maparle

    (@maparle)

    Thanks, What could I put to show the url with the link instead of showing the phrase “Read the article”

    Plugin Author Mikko Saari

    (@msaari)

    Replace the text with <?php the_permalink(); ?>.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Relevanssi not replacing default wordpress search’ is closed to new replies.