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

Displaying the post metas on home page
Published 18 January 2014

Displaying the post metas on home page

If your home page displays your last WordPress posts, you may have noticed that the posts on home don”t show the metas […]

Change the size of the Social Icons
Published 15 October 2013

Change the size 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 […]

Published 12 January 2014

Adding an update status next to post titles in WordPress

This simple snippet adds an update status after your post title in WordPress. It checks if the post has been updated since […]

How to display the Customizr(-Pro) vertical menu only in mobiles
Published 14 December 2015

How to display the Customizr(-Pro) vertical menu only in mobiles

Here’s a simple snippet in order to display the vertical menu only in mobiles, keeping the regular one in desktop devices: add_filter(‘tc_opt_tc_menu_style’, […]

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