Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #957474

    Hello experts,
    again a question related to rich snippets.
    Google doesn’t support svg logos for structured data.
    But my websites are using a svg as logo and Enfold is telling google to use it in rich snippets which leads to errors in the testing tool and I think also in search results.

    How do I tell Enfold to use a different logo file (jpg or png) for structured data than the logo file that is used to display?
    I guess this is possible.

    Best regards,
    Ralf

    #958590

    Hey Ralf,
    Please edit /wp-content/themes/enfold/includes/helper-markup.php
    line 360:

    <span itemprop='url'>{$logo_url}</span>

    2018-05-18_070950
    replace {$logo_url} with the url to the logo you wish to use for structured data, like this:

    <span itemprop='url'>http://127.0.0.1/2017demo/wp-content/uploads/2017/02/logo-white.png</span>

    Best regards,
    Mike

    #958620

    Hey Mike,
    that works fine! Thanks a lot!

    Last question: how to put that modified file in my child theme?
    I tried it pure in the child themes folder and in a subfolder “includes” – but this didn’t work.

    Best regards,
    Ralf

    #959119

    Hi,
    Try adding this code to the end of your functions.php file in Appearance > Editor:

    if(!function_exists('av_blog_entry_markup_helper'))
    {
    	function av_blog_entry_markup_helper( $id , $exclude = array())
    	{
    		if( !in_array('publisher', $exclude) )
    		{
    			$output .= "<span class='av-structured-data' {$publisher_markup}>
    				<span itemprop='name'>{$author_name}</span>
    				<span itemprop='logo' itemscope itemtype='http://schema.org/ImageObject'>
    				   <span itemprop='url'>url-to-logo-image</span>
    				 </span>
    			  </span>";
    		}
    		return $output;
    	}
    }
    

    then replace “url-to-logo-image” in the code with your logo url

    Best regards,
    Mike

    #960175

    Hi Mike,
    I tried that but unfortunatelly it makes 16 errors instead of 4 without the modification.
    Try a look at the test tool.

    #960302

    Hi,
    When I look at your link it says zero errors, perhaps it’s not correct?
    Please see screenshot in Private Content area.

    Best regards,
    Mike

    #960320

    Ah sorry,
    my fault. I had to install a backup. So my mods of this morning were gone before you could read it.

    Now it is again with your code in functions.php instead the modification of helper-markup.php.

    Thanks Mike!

    #960572

    Hi,
    Yes that is not working, so was the modified helper-markup.php working correctly?
    if so, you may need to copy the whole file into your functions.php

    Best regards,
    Mike

    #960665

    Yes, the modification in helper-markup.php was working fine.
    Should I really copy that whole file into functions.php ? And I guess I will have to change it on updates too. Umm. Maybe I stay with the mod of helper-markup.php …

    #960701

    Hi,
    Is there anything else we can assist with on this issue, or shall we close this then?

    Best regards,
    Mike

    #961466

    Thanks Mike,
    I didn’t try to copy the whole file into functions.php of the child theme. If there is no other way to do this, the case can be closed.

    Thanks a lot!
    Ralf

    #961920

    Hi,
    Glad we were able to help, we will close this now. Thank you for using Enfold.

    For your information, you can take a look at Enfold documentation here
    And if there are features that you wish Enfold had, you can request them and vote the requested ones here
    For any other questions or issues, feel free to start new threads under Enfold sub forum and we will gladly try to help you :)

    Best regards,
    Mike

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Enfold SVG logo and a different logo for Rich Snippets’ is closed to new replies.