Relevanssi does not see that text, most likely. Is the text in the post inside a short code?
Using shortcodes only, Relevanssi does index the content, but using Elegant Builder (producing the same page), Relevanssi does not index the content of the toggle.
Can this content be visible to Relevanssi through some added code?
You can use relevanssi_content_to_index
filter hook to add arbitrary content to posts before they are indexed by Relevanssi.
Thanks for the quick reply.
Should the filter hook be added to the Elegant builder elements in some way? We are not clear on how to use it I’m afraid.
add_filter('relevanssi_content_to_index', 'add_more_content', 2);
function add_more_content($content, $post) {
$stuff_you_want_to_add = function_that_returns_the_stuff_you_want($post->ID);
$content .= $stuff_you_want_to_add;
return $content;
}
Add this to your theme functions.php, and add the content you want Relevanssi to see.
Thanks for the reply.
We have a static pages only configuration (no blog/posts). Should the code be changed according to this?
Should the function/filter be called upon on each page, or in the theme php files somewhere..?
No; from WP back end point of view, posts and pages are exactly the same, just with a different label. There’s nothing post/page specific in it.
Put the code in functions.php of your theme, and it will handle everything. You need to replace function_that_returns_the_stuff_you_want($post->ID);
with whatever it is you want to add to the post content. I don’t know what that is and how it is done, that’s up to you, but if you need the current post ID, it’s in $post->ID.