Leave a Reply

5 Comments

  1. hasan

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

    how/where i use this code?

    • Dhinju Divakaran

      $image[0] holds your logo url. So this can be use in your header.php file. Or the file that uses your logo for eg. footer.php.

      <img class="logo" src="”>

  2. Hello,

    My site (proddigital.com.br) talks about different subjects, and therefore, I separated into categories, where each category was configured color and logo customized through the child theme.

    But after updating the main theme, the custom logo on the header no longer appears, and the main logo is shown instead. See here (http://proddigital.com.br/investimentos/).

    The strange thing is that in the footer the custom logo appears normal, and also, if you drag the page up, show a smaller header with the custom logo. But in the bigger header, only the main logo appears (yellow color).

    Why does this happen?

    • Dhinju Divakaran

      Hi Rodrigo Carlos,

      WordPress Custom logo supports for whole website. So WordPress custom logo feature is not applicable for your website. My advise is that you apply same logic for main logo as in the footer logo.

  3. Hi Dhinju,
    Great article.

    I am working a new WordPress theme. The theme will have the option to set a logo in the customizer as normal. This is working.

    However, I want the theme to automatically set a DEFAULT logo. If the user doesn’t define a logo in the customizer, then the default logo will display automatically. I have an image called logo.jpg in a folder call img in the theme root.

    I am using this code to set the default logo but it is not working:
    Any ideas?
    Thanks!

    add_filter( ‘get_custom_logo’, ‘apply_default_logo’ );
    function apply_default_logo( $html ){
    if( empty( $html ) ) {
    $html = ”;
    }
    return $html;
    }

Next ArticleEXAMPLES OF CREATIVE WEB DESIGN BLOGS