Skip to content
Back Home
  • Customizr Pro
  • Hueman Pro
  • Nimble Page Builder
  • Blog
  • Search
Back Home
  • Customizr Pro
  • Hueman Pro
  • Nimble Page Builder
  • Blog
Home » Snippets » WordPress functions » add_action() » Display both logo and title in header
code snippets php Logo Title __after_logo add_action() printf() tc__f()

Display both logo and title in header

by Nicolas|Published 19 December 2013

⚠️ Code snippets might not be compatible with the latest version of your theme. Always use a child theme to customize your theme, and test your code on a staging website before migrating to production.

You can search the user’s forum or ask the user community by opening a new thread in the Customizr theme forum. Before opening a new topic, you might want to follow the troubleshooting steps..

Here’s a quick snippet to display both your logo and your site title in the header.

 

add_action( '__after_logo' , 'display_my_site_title');
function display_my_site_title() {
    //first checks if there is a logo uploaded
    $logo_src               = esc_url ( tc__f( '__get_option' , 'tc_logo_upload') ) ;
    if ( empty($logo_src) ) 
        return;

   //then print the site title after
    printf('<h1><a class="site-title" href="%1$s" title="%2$s | %3$s">%4$s</a></h1>',
        esc_url( home_url( '/' ) ),
        esc_attr( get_bloginfo( 'name') ),
        esc_attr( get_bloginfo( 'description' ) ),
        esc_attr( get_bloginfo( 'name') )
    );
}

 

Where to copy/paste this code? => in your functions.php file. I strongly recommend to create a child theme. Download a start-up child theme here.

Everything you need to know about child theme with Customizr here.

Hope this will help!

AUTHOR

Nicolas
Hi! I'm Nicolas (@presscustomizr), the lead developer of the Customizr Theme and the Hueman Theme. My team and I are working everyday to help you publish your WordPress content the best possible way. We love to do it!Thanks for visiting this website, feel free to drop us a line !
0 posts

You may also like

Move the Social Icons and Tagline
Published 8 October 2013

Move the Social Icons and Tagline

Where to copy/paste this code? The simplest way is to use the Custom CSS section of the customizer option screen. If you […]

Adding a multi-line tagline
Published 12 October 2013

Adding a multi-line tagline

Your site’s tagline is used to explain, in a few words, what the site is about. But maybe you want to use […]

Change title of time-based archives
Published 14 March 2016

Change title of time-based archives

If you want to change the titles of daily,monthly or yearly archives, add this to your child theme’s functions.php and modify the […]

Reduce gap between Slider and Zoom Image
Published 9 October 2013

Reduce gap between Slider and Zoom Image

Where to copy/paste this code? The simplest way is to use the Custom CSS section of the customizer option screen. If you […]

Impress your visitors with a perfect experience on smartphones

customizr-pro-screenshot

10K+ small businesses are already using the Customizr Pro WordPress theme for their online presence.

Discover Customizr Pro

Post navigation

  • Previous post Change size/color of the Post/Page Icon & Title
  • Back to post list
  • Next post Disable the reveal hover effect on images in Customizr
Useful pages
  • Your account
  • Product Support
  • Documentation
  • WP code snippets for Customizr theme
  • Work with us
Company
  • About
  • Blog
  • Privacy Policy
  • Terms of sale
  • Contact Us
Products and Services
  • Customizr Pro
  • Hueman Pro
  • Customizr WordPress Theme
  • Hueman WordPress Theme
  • Nimble Builder

© 2021 Press Customizr – All rights reserved