• Hi!

    We’re currently using WP3.6 together with “Elegant Builder”from Elegant Themes. We also use Relevanssi for search. Unfortunately Relevanssi seems to not index text that has been entered in the various “toggle areas” that we use. Is there a workaround in order to get this to work – maybe an amendment to the indexing.php file…

    Many thanks in advance!

    http://wordpress.org/plugins/relevanssi/

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

    (@msaari)

    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?

    Plugin Author Mikko Saari

    (@msaari)

    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.

    Plugin Author Mikko Saari

    (@msaari)

    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..?

    Plugin Author Mikko Saari

    (@msaari)

    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.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Relevanssi not indexing "Elegant theme toggle text"’ is closed to new replies.