• Resolved tinodesigns

    (@tinodesigns)


    Hi,

    we are optimizing our site and I’m trying to add the missing width=”” and height=”” attributes to the logo image tag. However I’m failing to do so.

    Where can I add those attributes so that they actually show on the site? I added it to the template-tags.php file (line 557) but that didn’t seem to do it.

    Any other place I’m missing where that code is actually being generated?

    Thanks,
    Tino

Viewing 3 replies - 16 through 18 (of 18 total)
  • Theme Author Tom

    (@edge22)

    Like this:

    add_filter( 'generate_mobile_header_logo_output','tu_mobile_logo_atts' );
    function tu_mobile_logo_atts( $output ) {
    	printf( 
    		'<div class="site-logo mobile-header-logo">
    			<a href="%1$s" title="%2$s" rel="home">
    				<img width="234" height="80" class="header-image" src="%3$s" alt="%2$s" title="%2$s" />
    			</a>
    		</div>',
    		esc_url( apply_filters( 'generate_logo_href' , home_url( '/' ) ) ),
    		esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ),
    		esc_url( apply_filters( 'generate_mobile_header_logo', 'https://www.ncsvehicledonations.com/wp-content/uploads/2016/04/[email protected]' ) )
    	);
    }

    Please remember to direct further GP Premium questions to our forum: https://generatepress.com/support

    I get in trouble for answering them here.

    Thanks!

    Thread Starter tinodesigns

    (@tinodesigns)

    Hi Tom,

    thanks a lot that worked. I’ll get support next time from the GP support forum.

    Best,
    Tino

    Theme Author Tom

    (@edge22)

    Thank you! ??

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘adding width and height attributes to logo’ is closed to new replies.