Continue reading GeneratePress: Query Loop

GeneratePress: Query Loop

Relevanssi doesn’t work automatically with the Query Loop block in GeneratePress and GenerateBlocks. Fortunately, the solution is simple: the Query Loop block has a filter hook for adjusting the query parameters, and you can use that filter hook to enable Relevanssi. Add this to your site: Thanks to Ben Knowles. If you are using V2…

Read more GeneratePress: Query Loop 0 Comment on GeneratePress: Query Loop
Continue reading Gutenberg Full Site Editing

Gutenberg Full Site Editing

There’s a compatibility issue between Relevanssi and Gutenberg Full Site Editing. No results are found when you create a Query Loop to display the search results with Relevanssi enabled. The blank results happen because the post template block doesn’t use the Relevanssi results but instead uses a new WP_Query. Since Relevanssi still blocks the default…

Read more Gutenberg Full Site Editing 2 Comments on Gutenberg Full Site Editing
Continue reading OceanWP

OceanWP

…$post->blog_id ); } ?> <article id=”post-<?php the_ID(); ?>” <?php post_class(); ?>> <div class=”search-entry-inner clr”> <?php // Featured Image. get_template_part( ‘partials/search/thumbnail’ ); ?> <div class=”search-entry-content clr”> <?php // Title. get_template_part( ‘partials/search/header’ ); // Content. get_template_part( ‘partials/search/content’ ); // Read more button. get_template_part( ‘partials/search/readmore’ ); ?> </div><!– .search-entry-content –> </div><!– .search-entry-inner –>……file partials/search/content.php with this content: <?php /** * Search result page entry content * * @package OceanWP WordPress theme */ // Exit if accessed directly. if ( ! defined( ‘ABSPATH’ ) ) { exit; } global $post; // Excerpt length. $length = apply_filters( ‘ocean_search_results_excerpt_length’, ’30’ ); ?> <div class=”search-entry-summary clr”<?php…?>” title=”<?php the_title_attribute(); ?>” rel=”bookmark”><?php function_exists( ‘relevanssi_the_title’ ) ? relevanssi_the_title() : the_title(); ?></a> </h2> </header> This template uses the relevanssi_the_title() function to print out the title to make sure the highlights are included. Multisite searching If you want to use multisite searching with OceanWP, it’s easiest to make the template…

Read more OceanWP 0 Comment on OceanWP
Continue reading Oxygen and Ninja Tables

Oxygen and Ninja Tables

…the fix is simple: you can make Relevanssi look for the Ninja Tables shortcodes in the Oxygen custom fields. Add this code to a code snippet: add_filter( ‘relevanssi_custom_field_value‘, ‘rlv_oxygen_ninja’, 9, 2 ); function rlv_oxygen_ninja( $values, $field ) { if ( ‘ct_builder_shortcodes’ === $field ) { $values = array_map( ‘relevanssi_index_ninja_tables’, $values…

Read more Oxygen and Ninja Tables 0 Comment on Oxygen and Ninja Tables
Continue reading ThemeCo

ThemeCo

ThemeCo themes use custom codes for dynamic content. Those are not usual shortcodes, and Relevanssi won’t expand them automatically. In order to expand the dynamic content from ThemeCo themes, you need to use these filters: The critical part is running these filters on an early enough priority for relevanssi_post_content: Relevanssi page builder shortcode cleanup runs…

Read more ThemeCo 0 Comment on ThemeCo
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