Continue reading Premium 2.2.3.1

Premium 2.2.3.1

Sometimes unexpected things happen when releasing updates for Relevanssi Premium. Version 2.2.3 passed all our tests with flying colours and during our local testing showed no signs of trouble. However, once it was released, bug reports started trickling in – incompatibility with the Redirection plugin (which we’ve never used), problems with Internet Explorer (which we…

Read more Premium 2.2.3.1 2 Comments on Premium 2.2.3.1
Continue reading Premium 2.2.3 / Free 4.1.2

Premium 2.2.3 / Free 4.1.2

2.2.3 adds a new Premium feature: redirects. This feature allows you to define keywords that will be automatically redirect the user to a certain page. While this feature is only available for Premium users, this update is still very much worth the while for the users of free Relevanssi. For…

Read more Premium 2.2.3 / Free 4.1.2 0 Comment on Premium 2.2.3 / Free 4.1.2
Continue reading Premium 2.2.2.1 / Free 4.1.1.2

Premium 2.2.2.1 / Free 4.1.1.2

The latest update unfortunately broke the User searches page. This update fixes that problem. I’ve also updated my test suite to catch further errors like those, so similar issues should not happen again. The Premium update also includes a minor improvement, where the “How Relevanssi sees this post” feature is…

Read more Premium 2.2.2.1 / Free 4.1.1.2 0 Comment on Premium 2.2.2.1 / Free 4.1.1.2
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

…) ) { 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’ =>……wc_get_page_id( $wc_page_type ) ) { $wc_page = true; } } } if ( ! $wc_page ) { array_push( $pages, $post->ID ); } } do_action( ‘flatsome_products_page_loader’ ); if ( ! empty( $posts ) || ! empty( $pages ) ) { $list_type = get_theme_mod( ‘search_result_style’, ‘slider’ ); if ( ! empty( $posts…) ) { echo ‘<hr><h4 class=”uppercase”>’ . __( ‘Posts found’, ‘flatsome’ ) . ‘</h4> ‘ . do_shortcode( ‘[blog_posts columns=”3″ columns__md=”3″ columns__sm=”2″ type=”‘ . $list_type . ‘” image_height=”16-9″ ids=”‘ . implode( ‘,’, $posts ) . ‘”]’ ); } if ( ! empty( $pages ) ) { echo ‘<hr><h4 class=”uppercase”>’ . __(…

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
Continue reading Premium 2.2.1

Premium 2.2.1

…can now index post type archive pages. This’ll probably be rarely needed, since editing post type archive content is a bit tricky, but some will probably find this very useful. Changelog to 2.2 New feature: Search tab on Relevanssi settings page allows you to perform searches in WP admin using……filter hook got a second parameter that holds the post ID. Custom field sorting actually works now. WP Search Suggest compatibility added. Changelog to 2.2.1 The admin search has been moved to a separate page and made visible to editors, authors and contributors. New filter: relevanssi_admin_search_capability can be used to…

Read more Premium 2.2.1 0 Comment on Premium 2.2.1
Continue reading Searching between dates

Searching between dates

…$from_date[‘month’], ‘day’ => $from_date[‘day’], ); } // Same for the “to” date. if ( $to_date && checkdate( $to_date[‘month’], $to_date[‘day’], $to_date[‘year’] ) ) { $before = array( ‘year’ => $to_date[‘year’], ‘month’ => $to_date[‘month’], ‘day’ => $to_date[‘day’], ); } // Create the date query array and add the parameter sets to it……) ) { $to_date = date_parse( $_GET[‘to’] ); } $after = null; $before = null; // If the “from” date checks as a valid date, create a parameter set for it. if ( $from_date && checkdate( $from_date[‘month’], $from_date[‘day’], $from_date[‘year’] ) ) { $after = array( ‘year’ => $from_date[‘year’], ‘month’ =>……searches: add_filter( ‘relevanssi_modify_wp_query’, ‘rlv_date_between’ ); function rlv_date_between( $query ) { $from_date = null; $to_date = null; // Get the dates from parameters “from” and “to”, and parse to make sure they are dates. if ( isset( $_GET[‘from’] ) ) { $from_date = date_parse( $_GET[‘from’] ); } if ( isset( $_GET[‘to’]…

Read more Searching between dates 17 Comments on Searching between dates