Continue reading Events Calendar: Remove past events from search

Events Calendar: Remove past events from search

If you have events on your site, you might not want to show the past events in the search. This is easy to do with Relevanssi. It can be done in two ways: either you block the past events in indexing or in searching. In most cases, the best solution is to do both. Blocking…

Read more Events Calendar: Remove past events from search 6 Comments on Events Calendar: Remove past events from search
Continue reading Indexing embedded PDFs for the parent post

Indexing embedded PDFs for the parent post

Relevanssi can automatically index PDF content for the parent post if the PDF (or other attachment) is attached to the parent post in WordPress. However, that’s not always the case. Sometimes the PDF is attached to the page using an embed, which doesn’t create a connection between the posts in WordPress. Thus, Relevanssi won’t know…

Read more Indexing embedded PDFs for the parent post 5 Comments on Indexing embedded PDFs for the parent post
Continue reading Chamber Dashboard Business Directory

Chamber Dashboard Business Directory

The Chamber Dashboard Business Directory plugin has a business directory search that’s not compatible with Relevanssi. To disable Relevanssi in those searches, add this to your theme functions.php: This will make the business directory search work again. However, I would recommend just using Relevanssi to search the business directory as well – that’s possible, and…

Read more Chamber Dashboard Business Directory 0 Comment on Chamber Dashboard Business Directory
Continue reading Indexing HTML comments

Indexing HTML comments

By default, Relevanssi does not index HTML comments inside your posts. Relevanssi removes all HTML tags before indexing, and HTML comments (<!– like this –>) are counted as HTML tags. If you have content inside comments that you want to be indexed, you need to modify the punctuation control – which is responsible for removing…

Read more Indexing HTML comments 0 Comment on Indexing HTML comments
Continue reading Toolset Views

Toolset Views

Relevanssi works fine with Toolset, thanks to a lot of compatibility code the makers of Toolset have included in it to make it work with Relevanssi. However, everything doesn’t work automatically without modifications. The key thing to notice with Toolset is that query variables and filters don’t work the way you’d expect. Because of the…

Read more Toolset Views 6 Comments on Toolset Views
Continue reading Indexing post slugs

Indexing post slugs

By default, Relevanssi does not index the post slug. It is, however, an easy thing to fix using the relevanssi_content_to_index filter hook. This function will read the post slug, replace the hyphens with spaces (so that indexing-post-slugs becomes “indexing post slugs”) and add the slug to the post content. Add this function to your site…

Read more Indexing post slugs 0 Comment on Indexing post slugs
Continue reading Flatsome

Flatsome

…$query, $args, $defaults ) { global $flatsome_live_search_query; $flatsome_live_search_query = $args[‘s’]; $args[‘relevanssi’] = true; return get_posts( $args ); } This stores the search query in a global variable so that we can use it later elsewhere. Then we need a filter function to adjust the permalinks so that when the search……) ) { return; } global $post; if ( get_search_query() ) { $args = array( ‘post_type’ => ‘post’, ‘s’ => get_search_query(), ‘relevanssi’ => true, ); $query = new WP_Query( $args ); $posts = array(); while ( $query->have_posts() ) { $query->the_post(); array_push( $posts, $post->ID ); } $args = array( ‘post_type’ =>……post objects. */ function rlv_flatsome_search_function( $query, $args, $defaults ) { $args[‘relevanssi’] = true; return get_posts( $args ); } add_filter( ‘flatsome_ajax_search_function’, function() { return ‘rlv_flatsome_search_function’; } ); Improving live search with product variations If you want the live search to take the searcher directly to the right variation, here’s what you…

Read more Flatsome 0 Comment on Flatsome
Continue reading Restricting the search for non-logged-in users

Restricting the search for non-logged-in users

There was an interesting support question: I have website with logged-in users as well as non-logged-in users. The logged-in user should be able to search through everything on the website, but the non-logged-in users should only be able to search the user profiles. Is it at all possible to differentiate the searches like this? The…

Read more Restricting the search for non-logged-in users 3 Comments on Restricting the search for non-logged-in users