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 Navbar Colors/Font/Size
Published 14 October 2013

Change the Navbar Colors/Font/Size

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

Sub-menu drop down on mouse hover
Published 23 September 2013

Sub-menu drop down on mouse hover

Note: While this snippet is still valid for Twitter Bootstrap menu based, Customizr and Customizr-Pro now embed a new option to achieve […]

Add a Polylang dropdown with a navbar widget
Published 29 July 2014

Add a Polylang dropdown with a navbar widget

Learn how to add a navbar widget, so that you can put a Polylang Language Switcher dropdown in it

Replace … with “Read More” link or button
Published 2 March 2016

Replace … with “Read More” link or button

In the alternate thumbnails layout, the default display shows the excerpt with a […] at the end. The thumbnail and the title […]

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