Arifur.bd
Forum Replies Created
Viewing 1 replies (of 1 total)
-
Forum: Fixing WordPress
In reply to: How do I add a custom logo to a theme that doesn't let me have one?Hi, This is very easy issue. Just copy and pest this code in your functions.php at the bottom before closing php tag. ( ?> )
/** * Sample implementation of the Custom Header feature. * * * @link https://developer.ww.wp.xz.cn/themes/functionality/custom-headers/ * * @package ecapress */ /** * Set up the WordPress core custom header feature. * * @uses tmbd_header_style() */ function tmbd_custom_header_setup() { add_theme_support( 'custom-header', apply_filters( 'tmbd_custom_header_args', array( 'default-image' => '', // If you want use a default Logo url get_template_directory_uri() . '/images/your-logo.png', Like this 'width' => 250, // Set your logo Width 'height' => 60, // Set Your Logo Height 'flex-height' => true, ) ) ); } add_action( 'after_setup_theme', 'tmbd_custom_header_setup' );After add this code you will get image upload option in Appearance Section like this http://awesomescreenshot.com/01d5jjusbb
You can add header image as logo to header.php like so … Where you want show it
<?php if ( get_header_image() ) : ?>
” rel=”home”>
<img src=”<?php header_image(); ?>” width=”<?php echo esc_attr( get_custom_header()->width ); ?>” height=”<?php echo esc_attr( get_custom_header()->height ); ?>” alt=””>
<?php endif; // End header image check. ?>I Hope it will helpful for you.
Thanks.
Viewing 1 replies (of 1 total)