• Resolved jiggaman

    (@jiggaman)


    In my child theme page.php file I placed the following code at the very bottom of the loop:

    if(is_plugin_active('seo-by-rank-math/rank-math.php')) { echo "<!-- shortcode snippet -->" . do_shortcode('[rank_math_rich_snippet]'); }

    Which renders out:

    <div id="rank-math-rich-snippet-wrapper">
    
    				<h5 class="rank-math-title">Home</h5>
    
    									<div class="rank-math-review-image">
    						<img src="https://cdnname.com/content/uploads/sites/282/2019/09/25075152/company_logo_blue_green-300x300.jpg">
    					</div>
    				
    				<div class="rank-math-review-data">
    					[et_pb_section fb_built="1" _builder_version="3.29.3" background_color="rgba(12,0,0,0.43)" background_image="https://networkname.com/subblogname/wp-content/u
    
    									</div>
    
    			</div>

    Which is completely unusable…and not making sense.

    You guys should test against the biggest paid theme in the world…divi.

    Things like “do_shortcode” need to be used possibly when figuring out data?

    I don’t know is this a bug?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Rank Math SEO

    (@rankmath)

    Hello @jiggaman

    Thank you for contacting the support.

    To show the Shortcode’s content, please add yje following filter code in your theme’s functions.php file:

    add_filter( 'rank_math/snippet/html', function( $html ) {
    	echo do_shortcode( $html );
    });

    You can check all the available filters here:
    https://rankmath.com/kb/filters-hooks-api-developer/

    Hope that helps.

    Hi.

    I have the same problem than jiggaman using Divi.
    I let Rank Math implements automatically my rich snippets in my pages but actually it displays that in the header:
    <script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"Article","headline":"Comit\u00e9 de Parrainage & Partenaires","description":"[et_pb_fullwidth_header header_fullscreen=\"on\" header_scroll_down=\"on\" scroll_down_icon=\"%%1%%\" admin_label=\"En-t\u00eate plein \u00e9cran - COMIT\u00c9 DE PARRAINAGE & P","datePublished":"2016-09-26T19:44:52+02:00"...

    I’ve tried your code but without any success :(…
    What I’m doing wrong?
    Could you help me please?

    TIA.

    Pierre.

    Plugin Author Rank Math SEO

    (@rankmath)

    Hello @pierre_02

    Can you please update to the latest version and then add the above code in your theme’s functions.php file?

    Hope that helps. Thank you.

    Once updated, everything seems to work correctly and I have no more shortcode in the description :)!
    Great and I have no need for code in my theme’s functions.php file

    Thanks a lot for your work!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Divi and rich snippets’ is closed to new replies.