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

Change the color of the Social Icons
Published 12 November 2013

Change the color of the Social Icons

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

Change Grey Bar between Navbar and Slider
Published 15 October 2013

Change Grey Bar between Navbar and Slider

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 link in the WordPress tagline
Published 23 October 2013

Adding a link in the WordPress tagline

Howdy developer! The following is a quick and easy way to add a link in your tagline in the Customizr theme. We […]

Removing the page icon on the left of the page title
Published 23 September 2013

Removing the page icon on the left of the page title

If you find this icon ugly or you just don’t want to see it, copy and paste the following code in the […]

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