R
R
RushV2018-02-21 14:29:36
WordPress
RushV, 2018-02-21 14:29:36

How to display title attribute of wordpress logo?

Hello!
We decided to display a picture with this code . Is it possible to somehow implement the output of the title title of the logo?<?php the_custom_logo( $blog_id ); ?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Ainur Valiev, 2018-02-22
@vaajnur

add_filter( 'get_custom_logo', 'wecodeart_com' );
// Filter the output of logo to fix Googles Error about itemprop logo
function wecodeart_com() {
    $custom_logo_id = get_theme_mod( 'custom_logo' );
    $html = sprintf( '<a href="%1$s" class="custom-logo-link" rel="home" itemprop="url">%2$s</a>',
            esc_url( home_url( '/' ) ),
            wp_get_attachment_image( $custom_logo_id, 'full', false, array(
                'class'    => 'custom-logo',
                'title' => 'новый тайтл'
            ) )
        );
    return $html;   
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question