Skip to main contentSkip to footer

Simple bug fix release. 1.7.8 had some overeager optimization attempts that failed and caused some searches simply not work. I removed those and everything should work now.

Your account

Not logged in. Log in to see your license details.

Search

Popular Resources

Click tracking
Relevanssi Premium 2.16 introduced a new feature of click tracking. It allows you to see the effectiveness of the search,…
Category filter for search results pages

Sometimes it’s nice to have a category filter on the search results pages: a simple dropdown where you can choose the category you want to show. It’s easy to create one using wp_dropdown_categories() but on a search results page, that’s slightly problematic, as it’ll include all categories, not just those……in place, there’s instead a link that removes all category filters. function rlv_category_dropdown() { global $rlv_categories_present, $wp_query; if ( ! empty( $wp_query->query_vars[‘cat’] ) ) { $url = esc_url( remove_query_arg( ‘cat’ ) ); echo “<p><a href=’$url’>Remove category filter</a>.</p>”; } else { $select = “<select id=’rlv_cat’ name=’rlv_cat’><option value=”>Choose a category</option>”; foreach (……} } asort( $rlv_categories_present ); return $hits; } Add this snippet to your site. If you want this to use WooCommerce product categories, replace the category in the get_the_terms() call with product_cat like this: $terms = get_the_terms( $hit->ID, ‘product_cat’ ); Then we can create the function that displays the dropdown….

Auto-redirecting with one search result

…$wp_query; if ( 1 === $wp_query->post_count ) { switch_to_blog( $wp_query->posts[‘0’]->blog_id ); wp_redirect( get_permalink( $wp_query->posts[‘0’]->ID ) ); exit(); } } } The code is originally from WP Beginner. If you want to redirect particular search terms to posts without going through the search results page, that looks like this: add_action( ‘template_redirect’,…

Related Posts:

Currently there are no related posts available.

Comment Section:

3 Comments. Leave new

  • Great plugin, but I have got a problem. The update core page displays all the time, that relevanssi is not up to date.. How can I fix this problem, because it’s a litte bit annoying.. 🙂

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed