Thread Starter
syseng
(@syseng)
solved with relevanssi plugin and some codes.
add_action('template_redirect', 'one_match_redirect');
function one_match_redirect() {
if (is_search()) {
global $wp_query;
if ($wp_query->post_count == 1) {
wp_redirect( get_permalink( $wp_query->posts['0']->ID ) );
}
}
}
add_filter('relevanssi_index_content', 'contentoff');
function contentoff() {
return false;
}
Thread Starter
syseng
(@syseng)
solved by me. thanks again.
Thread Starter
syseng
(@syseng)
i’ve solved my question but will not write how to do it. thanks to help me.