Support » Plugin: Search Meter » Search Meter not working with Relevanssi

  • When I use this combination, Search Meter does not record the search result. It recognizes that a search was made, but it always shows 0 results in the statistics panel.

    I’ve tried toggling several settings, can anyone help me with this?

Viewing 1 replies (of 1 total)
  • Search Meter runs on the_posts with priority 20, Relevanssi is on the same hook with priority 99. Thus, Search Meter goes before Relevanssi and doesn’t see the results Relevanssi finds.

    Add this to your theme functions.php, and things might start working better:

    add_action( 'init', 'switch_search_meter_priority' );
    function switch_search_meter_priority() {
        remove_filter( 'the_posts', 'tguy_sm_save_search', 20 );
        add_filter( 'the_posts', 'tguy_sm_save_search', 100 );
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Search Meter not working with Relevanssi’ is closed to new replies.