Site logo

Archived topic

the_custom_logo not working in element hook

2 replies · Started by Sebastian on April 26, 2022

Viewing posts 1–3 of 3

Hey guys,

I would like to insert a custom topbar with custom content inside. One of the contents is the site logo, however I don't succeed to simply echo the_custom_logo(). I've also tried doing this, inserting the fetched url into an img tag:

$custom_logo_id = get_theme_mod( 'custom_logo' );
$image = wp_get_attachment_image_src( $custom_logo_id , 'full' );
echo $image[0];

But that didn't work either. Is running the_custom_logo() not possible anymore? I found this post suggesting this can be done.

Btw, my logo is an svg with no styling set to it.

This is the complete code I'm trying to enforce in the hook element:

<div class="itc-topbar">
      <div class="grid-container">
        <div class="itc-row vert-center">
          <div class="itc-col-4">
            <a href="tel:0700000000" class="itc-topbar__phone-nbr">
              <ul class="list--no-m list--no-bullet">
                <li class="icon phone">0700 - 000000</li>
              </ul> 
            </a>
          </div>
          <div class="itc-col-4">
            <?php the_custom_logo(); ?>
          </div>
          <div class="itc-col-4">
            <a href="#" class="btn rounded btn--violet btn--regular">Log in</a>
          </div>
        </div>
      </div>
    </div>

Thanks

I noticed the image actually is echoed out but it's 1x1 px in size. Sorry for that.

Hi there,

glad to hear you found the issue!

This archived topic is closed to new replies.