• I’d love some guidance for how to use custom snippets in a Block Theme. Our developer suggested that

    “With modern WP I do not think that will work. The search template is edited in the site editor. You can edit the template but you can not edit how the excerpt is called. If you wanted to use this you would need to create a search.php file in the root of the theme and add your query there.”

    Do you have any solutions existing or coming soon for this in Block theme?

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

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

    (@msaari)

    This at least used to work:

    add_filter( 'wp_trim_words', function( $text, $num_words, $more, $original_text ) {
    	global $post;
    	if ( isset( $post->relevance_score ) ) {
    		return $post->post_excerpt;
    	}
    	return $text;
    }, 10, 4 );

    Add this to your theme functions.php, and the core WP excerpt block should display the Relevanssi excerpts.

Viewing 1 replies (of 1 total)
  • The topic ‘Term highlighting in a block theme’ is closed to new replies.