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

Enter text above posts on a static blog page
Published 8 July 2014

Enter text above posts on a static blog page

If you’ve set up the Customizr theme so that you have you blog posts on a separate page, here’s how to include some text or other content above the posts.

Change the Color of the Comments Count Bubble next to the Post Title
Published 29 October 2013

Change the Color of the Comments Count Bubble next to the Post Title

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

Change Sidebar borders
Published 20 October 2013

Change Sidebar borders

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

Change the Background Color/Text Color of the 3-Bar Menu dropdown
Published 8 April 2014

Change the Background Color/Text Color of the 3-Bar Menu dropdown

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