• Resolved dianebakker70

    (@dianebakker70)


    Hi, I know you have fixes for several themes with builders, but I didn’t find anything for the Yootheme Pro Page Builder. If you search on https://wijn.studio-vici.nl/ for the word organic you will see a search result with code from the builder in it. The code starts with <!– {“name”:””,”type”:”layout”,”children”:[{“name”: etcetera.
    I would like to know if it is possible to force Relevanssi to ignore everything after the <!– and how? Thank you very much in advance!

    PS: my search.php is in https://pastebin.com/uu5cNCMf

    The page I need help with: [log in to see the link]

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

    (@msaari)

    How does that content appear in your post? Is it a shortcode?

    Thread Starter dianebakker70

    (@dianebakker70)

    Hi, Thanks for your reply. They are pages, not posts.
    Front end looks like this: https://wijn.studio-vici.nl/rode-wijn/coste-di-moro/ Backend looks like this: https://pastebin.com/GvMQzAmW
    Theme is Yootheme Pro based on UIkit framework.

    Plugin Author Mikko Saari

    (@msaari)

    To Relevanssi, everything is a post.

    Is there a case where something necessary would appear after a <!-- in your posts? If not, then it would be fairly easy to just cut off at the first <!-- seen in the post content.

    add_filter( 'relevanssi_post_content', 'rlv_remove_after_comment' );
    add_filter( 'relevanssi_pre_excerpt_content', 'rlv_remove_after_comment' );
    function rlv_remove_after_comment( $content ) {
    	$content = preg_replace( '/<!--.*/', '', $content );
    	return $content;
    }

    This should fix the problem for excerpts right away, but also rebuild the index to get rid of false matches.

    Thread Starter dianebakker70

    (@dianebakker70)

    Thanks for your reply ??
    Well, the relevant content is above the <! part (see my pastebin from my previous answer), so no, there’s nothing in the code part after the <! that should be found by Relevanssi. How do I cut it off at the first <! ? Where do I put the code you gave me?

    • This reply was modified 6 years, 6 months ago by dianebakker70.
    Plugin Author Mikko Saari

    (@msaari)

    Add the code to your theme functions.php. That should get rid of the commented content from index and excerpts.

    Thread Starter dianebakker70

    (@dianebakker70)

    Thank you so much! It works like a charm now ?? Much appreciated!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Yootheme Pro Page builder, fix for code in search results?’ is closed to new replies.