Continue reading Yoast Local SEO

Yoast Local SEO

Yoast Local SEO plugin breaks Relevanssi search. It enhances the search by adding meta queries. Unfortunately they don’t work with Relevanssi. The fix is simple, though. Add this to the theme functions.php: add_filter( ‘relevanssi_modify_wp_query’, ‘rlv_meta_fix’, 99 ); function rlv_meta_fix( $q ) { $q->set( ‘meta_query’, array() ); return $q; }add_filter( ‘relevanssi_modify_wp_query’, ‘rlv_meta_fix’, 99 ); function rlv_meta_fix(…

Read more Yoast Local SEO 14 Comments on Yoast Local SEO
Continue reading Adding a custom field filter in the search

Adding a custom field filter in the search

Adding a custom field filter in a Relevanssi search takes a little bit of programming, because the filter needs to create a meta_query that Relevanssi understands. Let’s assume we have some colour information in a custom field that’s called colour_field, and we want to use that to filter the search results. First, let’s add a…

Read more Adding a custom field filter in the search 48 Comments on Adding a custom field filter in the search
Continue reading Ordering search results by date

Ordering search results by date

I’m building a directory and would like the oldest posts to automatically display first in the search results, is this possible? I found out how to add a link that the user can click to sort the results but would like an automatic solution. Can you provide code that can be added to the functions.php…

Read more Ordering search results by date 3 Comments on Ordering search results by date