Support » Plugin: Relevanssi - A Better Search » Heading Custom Text Not Added To Index

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Mikko Saari

    (@msaari)

    What does the post_content column for this post look like in the wp_posts database table?

    Thread Starter tvisconti

    (@tvisconti)

    Plugin Author Mikko Saari

    (@msaari)

    The heading is contained in a shortcode attribute, which are by default not indexed by Relevanssi.

    If you add this to your theme functions.php and rebuild the index, Relevanssi will include the headings in the index:

    add_filter( 'relevanssi_pre_excerpt_content', 'rlv_shortcode_attribute', 8 );
    add_filter( 'relevanssi_post_content', 'rlv_shortcode_attribute', 8 );
    
    function rlv_shortcode_attribute( $content ) {
    	return preg_replace( '/\[vcex_heading.*?text="(.*?)".*?\]/im', '\1 ', $content );
    }
    Thread Starter tvisconti

    (@tvisconti)

    that worked thanks Mikko!

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.