Okay
  Public Ticket #1065677
Logo Schema
Closed

Comments

  •  2
    kuanbc started the conversation

    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

    <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] replied

    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)

  •  2
    kuanbc replied

    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..

    <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

  •  2
    kuanbc replied

    Hey Arlind,

    It's working now.

    I modified joinable.min.js, which it overrides the logo.php when the sticky header is turn on.

  • [deleted] replied

    Hi kuanbc.

    Glad to hear that :)

    Will set this ticket as solved from here.