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

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…
Indexing product codes with and without spaces

A Relevanssi Premium customer had a problem with product codes. The codes are in the format “ABC 100”, a group of letters and digits with a space in between. Users may search for the codes without the space, so the post should be found with “ABC 100” or “ABC100”. The……product can be found with either “ABC 123” or “ABC123” search * terms. This is applied to post content and titles. * * @param string $content The content to manipulate. * * @return string The content with the spaceless product codes added. */ function rlv_product_codes( $content ) { $pattern =…

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