• I am not a developer, so I apologize if this question is ignorant. I am building a website on MAMP using Elegant Themes’ “TheProfessional” template” on WP 3.7.1.

    I have read the instructions but cannot figure out how to set up Relevanssi so that it will index the text in the theme’s sidebars and toggles. I did not find the ‘query_post’ line in the search page template. I tried disabling the other plugins. I have checked and unchecked various boxes in the settings. Typing ‘all’ into the ‘custom fields to index’ box broke the theme.

    I searched the WP forums, and the one promising piece of advice I found was to add this to the theme functions.php:

    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;
    }

    I don’t know how to do this, though. Do I do this?

    add_filter(‘relevanssi_content_to_index’, ‘add_more_content’, 2);
    function add_more_content($content, $post) {
    $stuff_you_want_to_add = sidebars, custom_functions, widgets($post->ID);
    $content .= $stuff_you_want_to_add;
    return $content;
    }

    Thank you in advance for your advice.

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

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

    (@msaari)

    Sidebars in general are not tied to particular posts, and that’s why indexing them doesn’t make much sense.

    If you have sidebars that are related to single posts then yes, using ‘relevanssi_content_to_index’ filter is the best solution.

    However, if you don’t have a clue how to use the filter, I would suggest you hire someone who does. Figuring out how to do add the content you want is going to be difficult, if you’re not a developer.

    Thread Starter vickyjones

    (@vickyjones)

    Thank you for this prompt response. I can usually figure out how to make basic changes to CSS and some functions, but this one was beyond my ken, and I didn’t want to buy the pro version unless I felt certain I would be able to make it work.

    I was using a sidebar to post detailed contact information, office hours, and a map. I will put it elsewhere on on the website. I am sad, though, that I can’t get relevanssi to index the content in the toggles, though, because I am using toggles on the FAQs page; since FAQs are often searched for by readers, it is a shame that the content in the FAQs isn’t searchable.

    I was referred to Relevanssi by the support team at Elegant Themes. I’ll let them know that this tool can’t help me without further development work. But, again, I do appreciate your prompt response to my question. Thank you.

    Plugin Author Mikko Saari

    (@msaari)

    The toggles are probably feasible, depending on how they are done. If it’s a shortcode, for example, make sure Relevanssi is set to expand shortcodes in indexing.

    If you want to index contact information, it’s better to create a separate page for them, and then index that.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Indexing sidebars, widgets, shortcodes, and toggles’ is closed to new replies.