Skip to main contentSkip to footer

The Photo Gallery plugin from 10Web uses a shortcode to add photo galleries to posts and pages. By default, Relevanssi doesn’t index the gallery contents. Photo Galler only registers the shortcode in the front end, so when Relevanssi indexes pages in the admin context, Relevanssi only sees the shortcode, not the gallery contents.

To fix this problem, add this snippet to your site:

add_filter( 'relevanssi_post_content', function( $content ) {
    $bwg = BWG();
    add_shortcode( 'Best_Wordpress_Gallery', array( $bwg, 'shortcode' ) );
    return $content;
} );

This snippet activates the Best_Wordpress_Gallery shortcode when Relevanssi indexes post content. Now Relevanssi can see the gallery contents.

Your account

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

Search

Popular Resources

WooCommerce: Aelia Prices by Country product visibility

…$post = get_post( $post_id ); $post_type = $post->post_type; $product_id = $post->ID; if ( ‘product‘ === $post_type && function_exists( ‘wc_get_product’ ) ) { // Get the product object. $product = wc_get_product( $product_id ); // Check if the product is purchasable. if ( $product && ! $product->is_purchasable() ) { $post_ok = false;……Check if the product is purchasable. if ( $product && ! $product->is_purchasable() ) { $post_ok = false; } } return $post_ok; } This function uses the relevanssi_post_ok filter hook to control which posts are included in the search and the $product->is_purchasable() function to see if the product can be shown….Aelia has a Prices by Country for WooCommerce plugin, which can adjust prices based on customer country and hide products unavailable in a specific country. Jason James shared a function that makes Relevanssi hide unavailable products in search: add_filter( ‘relevanssi_post_ok’, ‘relevanssi_aelia_compatibility’, 10, 2 ); function relevanssi_aelia_compatibility( $post_ok, $post_id ) {…

WooCommerce 4.4 problems
Updating WooCommerce to version 4.4 breaks Relevanssi searches. After updating WooCommerce to version 4.4, Relevanssi searches no longer find results.…

Related Posts:

Comment Section:

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