Comments 2kuanbc started the conversationFebruary 17, 2017 at 9:04amHi, I am trying to optimize my logo SEO with schema markupSo I modified header-main.php and logo.php inside the tpls folder.A example of logo schema <div itemscope itemtype="http://schema.org/Organization"> <a itemprop="url" href="http://www.mysite.com/"> <img itemprop="logo" src="http://www.mysite.com/logo.jpg" alt="My logo"/> </a> </div> I got the rest of work except the itemprop="logo" part is not showing.Here is how I modified in the logo.php file. <img itemprop="logo" src="<?php echo esc_url( str_replace( array( 'http:', 'https:' ), '', $logo_image_url ) ); ?>" width="<?php echo $logo_image[1]; ?>" height="<?php echo $logo_image[2]; ?>" class="main-logo" alt="<?php echo sanitize_title( get_bloginfo( 'name' ) ); ?>" /> As you can see, I added itemprop="logo" within the img tag, however, it does not show. Do you have any idea what cause this issue or can you direct me to a right file to modify the code for this one? Thanks.[deleted] repliedFebruary 17, 2017 at 2:14pmHi there, I have changed these in our theme, you can check if this is working for you by replacing these files: 1. Download this file and replace it in this directory (of the theme): /tpls 2. Download this file and replace it in this directory (of the theme): /tpls I have tested it and worked: (view large version) 2kuanbc repliedFebruary 17, 2017 at 2:45pmHi Arlind,Thanks for the reply.It still not working, but I found out why.When the sticky header is enable, a span tag will be add into the logo section warping the logo's img tag.Something like this.. <div itemscope itemtype="http://schema.org/Organization"> <a itemprop="url" href="http://www.mysite.com/"> <span class="logo-entry logo-main current-logo loaded"> <img itemprop="logo" src="http://www.mysite.com/logo.jpg" alt="My logo"/> </span> </a> </div> Do you know how to keep the itemprop="logo" inside the img tag while having sticky header on?Thanks 2kuanbc repliedFebruary 17, 2017 at 3:12pmHey Arlind,It's working now. I modified joinable.min.js, which it overrides the logo.php when the sticky header is turn on.[deleted] repliedFebruary 20, 2017 at 11:47amHi kuanbc. Glad to hear that :) Will set this ticket as solved from here. Sign in to reply ...
Hi,
I am trying to optimize my logo SEO with schema markup
So I modified header-main.php and logo.php inside the tpls folder.
A example of logo schema
I got the rest of work except the itemprop="logo" part is not showing.
Here is how I modified in the logo.php file.
As you can see, I added itemprop="logo" within the img tag, however, it does not show. Do you have any idea what cause this issue or can you direct me to a right file to modify the code for this one? Thanks.
Hi there,
I have changed these in our theme, you can check if this is working for you by replacing these files:
1. Download this file and replace it in this directory (of the theme): /tpls
2. Download this file and replace it in this directory (of the theme): /tpls
I have tested it and worked:
(view large version)
Hi Arlind,
Thanks for the reply.
It still not working, but I found out why.
When the sticky header is enable, a span tag will be add into the logo section warping the logo's img tag.
Something like this..
Do you know how to keep the itemprop="logo" inside the img tag while having sticky header on?
Thanks
Hey Arlind,
It's working now.
I modified joinable.min.js, which it overrides the logo.php when the sticky header is turn on.
Hi kuanbc.
Glad to hear that :)
Will set this ticket as solved from here.