• Resolved steve92

    (@steve92)


    I installed the Relevanssi plugin and want to highlight article titles in search results. The plugin author says to replace the_title() with relevanssi_the_tite(). I looked in the search.php file but it’s not there.

    SOLVED. In the file template-parts/content-excerpt.php replace <?php the_title( sprintf( … with <?php relevanssi_the_title( sprintf(...

    • This topic was modified 3 weeks, 2 days ago by steve92.
    • This topic was modified 3 weeks, 2 days ago by steve92.
    • This topic was modified 3 weeks, 2 days ago by steve92.
    • This topic was modified 3 weeks, 2 days ago by steve92.
Viewing 1 replies (of 1 total)
  • Thread Starter steve92

    (@steve92)

    UPDATE:

    The code above works, but if you disable the Relevanssi plugin, the site won’t work properly.
    To fix this, replace the header part:

    <header class="entry-header">
    <?php if (function_exists('relevanssi_the_title')) {
    relevanssi_the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
    } else {
    the_title ( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
    }
    ...
Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.