[Solved] How to fix "Home > Results for ..." issue for Divi
-
Since Divi represents breadcrumbs as a part of the post/page content, you can see a strange "Home >> Results for <search term>" text in the each item on the search results page.
It's annoying. However this is the simple dirty fix for this problem.add_filter('wpfts_index_post', function($index, $post) { global $wp_query; // Cut breadcrumbs out of the post_content if (is_string($index['post_content']) && (strlen($index['post_content']) > 0)) { if (isset($wp_query->query_vars['s'])) { $subs = '~Home\s+»\s+Results\s+for\s+'.preg_quote($wp_query->query_vars['s']).'~'; $index['post_content'] = preg_replace($subs, '', $index['post_content']); } } return $index; }, 50, 2);Simple add this code to the functions.php of your Divi-child theme and this will remove prepend text from search results.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login