skip to Main Content

I’m using the template "Twentyseventeen" and created a child theme of it.
Now I added the_custom_logo(); to header.php and the custom-logo link is rendered,
but without the img src. So I have a blank space. I searched now for hours and can’t find the reason. Even if I switch back to orignal Twentyseventeen theme the img src was missing. Well I’m not very famiiar to wordpress and if anybody could help me to fix this? Thank you

2

Answers


  1. Hi πŸ™‚ try to add <img> like this

    <img src="<?php the_custom_logo();?>"/>
    

    In my theme I use This:

    <div class="logo">
            <a href="<?php echo get_home_url(); ?>">
                <?php $logo_id = get_theme_mod( 'custom_logo' );?>
                <?php echo wp_get_attachment_image( $logo_id , 'full' ); ?>
            </a>
        </div> 
    

    I hope that it help you πŸ™‚

    Login or Signup to reply.
  2. Possibly you don’t have custom logo set in the backend or it needs a reset.

    • Go to the Admin Dashboard > Appearance > Customizer > Site Identity
    • Check if you’ve set the custom logo there. If it is set, remove it
      and reset it.

    If you don’t see any option to set custom logo there, your theme doesn’t support custom logo option. In this case the_custom_logo() or related functions will not work. Read this guide to add support for custom logo and then using the URL or printing the logo with markup.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search