Template override not working for search-results-message.php

[ad_1]

I’ll fix that in the next version. Meanwhile, you can do this:

add_action( 'init', function() {
    global $wp_filter;
    unset( $wp_filter['wp_ajax_relevanssi_live_search_messages'] );
    unset( $wp_filter['wp_ajax_nopriv_relevanssi_live_search_messages'] );

    add_action( 'wp_ajax_relevanssi_live_search_messages', 'custom_get_ajax_messages_template' );
    add_action( 'wp_ajax_nopriv_relevanssi_live_search_messages', 'custom_get_ajax_messages_template' );
}, 11 );

function custom_get_ajax_messages_template() {
    ob_start();
    include __DIR__ . '/templates/search-results-messages.php';
    $content = ob_get_clean();
    wp_send_json( $content );
}

2.2.0 is out now, so you should be able to just override the template.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer