• Resolved alien333

    (@alien333)


    Hi
    My search results are not showing the highlights any more (I think it happened after an update to my theme). I’m using Oceanwp theme. I tried changing the Relevanssi excerpt length setting also but it is not changed when you look at the search results.
    Reading through some possible solutions here it seems that my excerpts are not actually generated by Relevanssi. How can I rectify this issue?
    Can you please assist?

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

    (@msaari)

    OceanWP uses this to display the excerpts:

    <?php
    // Display excerpt.
    if ( has_excerpt( $post->ID ) ) {
    	the_excerpt();
    } else {
    	// Display custom excerpt.
    	echo wp_trim_words( strip_shortcodes( $post->post_content ), $length ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    }
    ?>

    I don’t think this works with Relevanssi. In your child theme, replace this part of the template (/search/content.php) with this:

    <?php the_excerpt(); ?>

    That way you’ll always get the Relevanssi excerpts.

    Thread Starter alien333

    (@alien333)

    Thank you – that worked great

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

The topic ‘Search results highlights’ is closed to new replies.