How to Display Your Site Name and Tagline in the WordPress Twenty Fifteen Header Template

By Lisa Sabin-Wilson

The default Twenty Fifteen theme header displays your site name and tagline on the top of your site, on every page. You can use the bloginfo(); tag plus a little HTML code to display your site name and tagline. Most sites have a clickable title, which is a site title that takes you back to the home page when it’s clicked. No matter where your visitors are on your site, they can always go back home by clicking the title of your site in the header.

To create a clickable title, use the following code:

<a href=“<?php bloginfo( ‘url’ ); ?>“><?php bloginfo( ‘name’ ); ?></a>

The bloginfo(url); tag is your main Internet address, and the bloginfo(name); tag is the name of your site. So the code creates a link that looks something like this:

<a href=“http://yourdomain.com”>Your Site Name</a>

The tagline generally isn’t linked back home. You can display it by using the following tag:

<?php bloginfo( ‘description’ ); ?>

This tag pulls the tagline directly from the one that you’ve set up on the General Settings page on your WordPress Dashboard (choose Settings → General).

This example shows how WordPress is intuitive and user-friendly; you can do things like change the site name and tagline with a few keystrokes on the Dashboard. Changing your options on the Dashboard creates the change on every page of your site — no coding experience required. Beautiful, isn’t it?

In the Twenty Fifteen templates, these tags are surrounded by tags that look like these: <h1></h1> or <p></p>. These tags are HTML markup tags, which define the look and layout of the site name and tagline in the CSS of your theme.

The header.php template file also includes the sidebar.php template file, which means it tells WordPress to execute and display all of the template functions included in the Sidebar template (sidebar.php). The line of code from the Header template that does this looks like this:

<?php get_sidebar(); ?>