Subscribe to RSS

Is your WordPress Theme holding you back?

Most WordPress Themes are created to look good, and rarely to play well with the plugins you choose to install.

I often encounter WordPress Themes which have customized code, which limits the functionality of the plugins I try to use.

The choice behind this is not necessarily a bad one, as the developers try to make it as easy for everyone to use, yet it limits more advanced users.

Let me show you an example I recently encountered.

The following code-snippet is from the header.php file of a theme I was tweaking for SEO purposes:

<title><?php if (is_home()) : ?><?php bloginfo(‘name’); ?> – <?php bloginfo(‘description’); ?>
<?php else : ?>
<?php wp_title(”, ‘false’); ?> – <?php bloginfo(‘name’); ?>

<?php endif; ?></title>

The code above can be confusing for users that are not used to program in PHP, so let me explain.

the <title>-tag is HTML-code, and is the title of the homepage itself. This is what will be shown in the top of your chosen browser.

With the code above, the theme showed the name of the blog and the description on the frontpage, and on all other pages, the title of the post/page followed by a “-” hyphen and then the name of the blog. (This is set up in the settings of your blog).

This is fine for most purposes, but when you want to tweak individual posts or perhaps the entire homepage for SEO, you will usually turn to a plugin, and the above code limits the functionality of these plugins.

The solution is quite simple. I edited the header.php of the theme, and changed the code to the following:

<title><?php wp_title(”,’false’); ?></title>

This code allows any plugin to manipulate the title of your homepage, instead of being limited by the Theme developer.

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

2 Comments

  1. Hi, I just wanted to say thanks for this post. It helped me configure my WordPress theme to work with the Headspace2 plugin. I don’t know a thing about php but your clear language made it easy to make this change to header.php. Keep up the great work!!

  2. I am a beginner in PHP but good at html though. This post clearly explained me and surely for those who would like to tweak WordPress , without PHP knowledge. Hoping to hear more from you like this.

Leave a Comment

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

PRIVACY POLICY: Your privacy is important to us. We will never sell or rent your email address and you can unsubscribe at any time.