-
AuthorPosts
-
May 16, 2018 at 1:13 pm #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,
RalfMay 18, 2018 at 1:16 pm #958590Hey Ralf,
Please edit /wp-content/themes/enfold/includes/helper-markup.php
line 360:<span itemprop='url'>{$logo_url}</span>
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,
MikeMay 18, 2018 at 3:20 pm #958620Hey 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,
RalfMay 19, 2018 at 6:04 pm #959119Hi,
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,
MikeMay 22, 2018 at 8:12 am #960175Hi Mike,
I tried that but unfortunatelly it makes 16 errors instead of 4 without the modification.
Try a look at the test tool.May 22, 2018 at 12:51 pm #960302Hi,
When I look at your link it says zero errors, perhaps it’s not correct?
Please see screenshot in Private Content area.Best regards,
MikeMay 22, 2018 at 1:11 pm #960320Ah 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!
May 23, 2018 at 1:28 am #960572Hi,
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.phpBest regards,
MikeMay 23, 2018 at 7:36 am #960665Yes, 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 …May 23, 2018 at 10:27 am #960701Hi,
Is there anything else we can assist with on this issue, or shall we close this then?Best regards,
MikeMay 24, 2018 at 11:46 am #961466Thanks 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!
RalfMay 25, 2018 at 2:17 am #961920Hi,
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 -
AuthorPosts
- The topic ‘Enfold SVG logo and a different logo for Rich Snippets’ is closed to new replies.