Support » Theme: Primer » add title tag to header logo

  • Resolved jbgglgdev


    Hi, is there a way to add the title tag to the logo on the hearder ?
    I had a look at template-tags.php file but did not find yet where to add the tag


Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @jbgglgdev,

    It looks like you’ll need to go through the core filter get_custom_logo. You can read about the filter here get_custom_logo.

    Here is an example using PHP str_replace to append a title="" attribute onto the <img tag.

    add_filter( 'get_custom_logo', function( $html, $blog_id ) {
       $html = str_replace( 'itemprop="logo"', 'itemprop="logo" title="testing"', $html );
       return $html;
    }, 10, 2 );

    As with the other thread you’ll want to add that to a custom MU plugin you create.

    Thread Starter jbgglgdev


    Great help, thank you very much.

    No problem at all – have a great weekend!


Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘add title tag to header logo’ is closed to new replies.