admin管理员组

文章数量:1122832

I'm trying to use my custom logo, uploaded from Appearance > Header. But none of the parameters I have set in my_custom_logo_setup are working.

In functions.php

//Add custom logo
    function my_custom_logo_setup() {
        $defaults = array(
            'height'               => 100, //not working!
            'width'                => 100, //not working!
            'flex-height'          => true, //not working!
            'flex-width'           => true, //not working!
            'header-text'          => array( 'site-title', 'site-description' ), //not working!
            'unlink-homepage-logo' => true, //not working!
        );
        add_theme_support( 'custom-logo', $defaults );
    }
    add_action( 'after_setup_theme', 'my_custom_logo_setup' );

In header.php:

<header id="masthead" class="site-header site-title site-description">
    <div class="site-branding">
        <?php if ( function_exists( 'my_custom_logo_setup' ) ) {
            the_custom_logo();
        } ?>
        <h1 class="site-title">Titulo</a></h1>
        <p class="site-description">Description</a></p>
    </div>
    <!-- .site-branding -->

    <!-- <nav id="site-navigation" class="main-navigation">
        
    </nav> -->
    <!-- #site-navigation -->

</header><!-- #masthead -->

本文标签: customizationCustom Logo why parameters are not working at all