Adding the Blog Description to a WordPress Site Title

Blog descriptions are great. They let the user know what the site is about, let google and other search engines know what the site is about and adds an overall professionalism to the site. WordPress has this feature built in, however, when developing a theme for wordpress, it is often troublesome to get the display of the tagline in the window title just right. Below we will run you through a few scenarios to display the WordPress ‘Tagline’.

1. On the homepage only

By default most wordpress themes only display the name on the homepage. This is because the code that displays the <title> in wordpress is only configurable once and most developers opt for a universal solution. How is this universal you may ask? Have a look at the following if we were to include it on all pages.

  • With the tagline on the <title> : Xenero | Sydney Web & App Design | About Us
  • Without the tagline on the <title> : About Us | Xenero (Way Better, Right)

Here’s how you can get it to display ONLY on the homepage.

Go to your wordpress dashboard and log in as an administrator. Then go to Appearance > Editor > Header.php and find this code :

<title> <?php wp_title("|",true, 'right'); > <?php if (!defined('WPSEO_VERSION')) { bloginfo('name'); } ></title>

 

Then replace the code with this :

<title> <?php wp_title("|",true, 'right'); > <?php if (!defined('WPSEO_VERSION')) {
// Add the blog name.
bloginfo( 'name' );

// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description &amp;&amp; ( is_home() || is_front_page() ) )
echo " | $site_description"; } ></title>

2. On All Pages

By default most wordpress themes only display the name on the homepage. This is because the code that displays the <title> in wordpress is only configurable once and most developers opt for a universal solution. How is this universal you may ask? Have a look at the following if we were to include it on all pages.

  • With the tagline on the <title> : Xenero | Sydney Web & App Design | About Us
  • Without the tagline on the <title> : About Us | Xenero (Way Better, Right)

Here’s how you can get it to display ONLY on the homepage.

Go to your wordpress dashboard and log in as an administrator. Then go to Appearance > Editor > Header.php and find this code :

<title> <?php wp_title("|",true, 'right'); > <?php if (!defined('WPSEO_VERSION')) { bloginfo('name'); } ></title>

 

Then replace the code with this :

<title> <?php wp_title("|",true, 'right'); > <?php if (!defined('WPSEO_VERSION')) {
// Add the blog name.
bloginfo( 'name' );

// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
echo " | $site_description"; } ></title>

3. Static Page Title (Same on All Pages Sitewide)

By default most wordpress themes only display the name on the homepage. This is because the code that displays the <title> in wordpress is only configurable once and most developers opt for a universal solution. How is this universal you may ask? Have a look at the following if we were to include it on all pages.

  • With the tagline on the <title> : Xenero | Sydney Web & App Design | About Us
  • Without the tagline on the <title> : About Us | Xenero (Way Better, Right)

Here’s how you can get it to display ONLY on the homepage.

Go to your wordpress dashboard and log in as an administrator. Then go to Appearance > Editor > Header.php and find this code :

<title> <?php wp_title("|",true, 'right'); > <?php if (!defined('WPSEO_VERSION')) { bloginfo('name'); } ></title>

 

Then replace the code with this :

<title>REPLACE YOUR TITLE TEXT HERE</title>

 

You then need to save your changes by pressing ‘Update File’ at the bottom of the editor. Hope this helped. Let us know if you have any questions below.

Join the discussion 11 Comments

  • Zain Kristopher says:

    I was suggested this website by my cousin. I am not sure whether this post is written by him as nobody else knows as much details about my difficulties as him. You’re wonderful! Thanks!

  • Selena Boyce says:

    I am ѕure this post has touсҺed all the internet visitors,
    it’ s a really really nice piece of writing on building up a new web blog.

  • Arthur Ramirez says:

    This is the perfect site for anybody who really wants to find out about this topic. You understand so much its almost tough to argue with you (not that I actually would want to…HaHa). You certainly put a fresh spin on a topic which has been written about for decades. Excellent stuff, just excellent!

  • Andrew Fenneck says:

    Are you able to help me with implementing SSO into my wordpress installation?

  • John Jackson says:

    Wonderful work! This is the kind of info that is meant to be shared across the internet. Shame on the search engines for not positioning this post higher! Come on over and consult with my website . Thank you

  • Michael Smith says:

    I got what you intended, thankyou for putting this article up. I am lucky to find this website through google. Being intelligent is not a felony, but most societies evaluate it as at least a misdemeanor and you my friend….have just committed a misdemeanor.

  • George Tyler says:

    WOW just what I was looking for. Came here by searching for prom themes for a project I’m developing and came across this. Thanks heaps

  • Geric Legg says:

    Love your article, Please keep posting. They are really helpful.

  • Sudan Kurrawong says:

    I have read so many content concerning the blogger lovers however this paragraph is really a good piece of writing, keep it up.

Leave a Reply