Closed artmelkon closed 3 years ago
line 13 reads 'custom-log' -- guessing it should probably be 'custom-logo'. but, there's more to discerned with that snippet.
https://developer.wordpress.org/themes/functionality/custom-logo/
I am able to use this guide from codex and can verify that within BlankSlate this setup works.
FIRST -- Add this to the functions.php file.
add_theme_support( 'custom-logo' ); function themename_custom_logo_setup() { $defaults = array( 'height' => 100, 'width' => 400, 'flex-height' => true, 'flex-width' => true, 'header-text' => array( 'site-title', 'site-description' ), ); add_theme_support( 'custom-logo', $defaults ); } add_action( 'after_setup_theme', 'themename_custom_logo_setup' );
THEN -- Add this to the header.php file.
<?php if ( function_exists( 'the_custom_logo' ) ) { the_custom_logo(); } ?>
Then use customize to load and publish.
Got it, and it works. Thank you
Hello,
Original creator of BlankSlate here. I'm sorry for the long hiatus, but I have been given permission to once again manage the project. So, I will again be pushing code updates and helping with user support.
Please let me know if you still need help with this specific issue and even if not, I would still like to get your feedback anyway:
https://github.com/tidythemes/blankslate/issues/23
Thanks!
Hello I am new to wordpress and would like to add custom logo to the page and placed this code in my functions.php, however, it's not sowing on the page. Can you tell me what am I doing wrong. Thanks
add_theme_support('custom-logo', array( 'height' => 54, 'width' => 310, 'flex-height' => true, 'flex-width' => true, 'header-text' => array( 'site-title', 'site-description' ), )); function companyname_logo() { if ( function_exists( 'the_custom_logo' )) { the_custom_logo(); } } $custom_logo_id = get_theme_mod( 'custom_log' ); $custom_logo_url = wp_get_attachment_image_url( $custom_logo_id, 'full' ); //echo ''; echo ''; //hard coded echo '';