Using tag_description() in WordPress To Create Unique Tag Pages

Something I’ve been testing on You’re Supposed To Be At Home is WordPress’  internal tag function. Tags are largely unused on blogs nowadays, and with good reason – tag pages create duplicate content. Often people just block them from search engines, but instead of blocking them, you can turn your tag pages into marvellous search engine friendly pages with rich content.

To do this, you need to make a few changes to your template. Open up tag.php and begin editing!

Switch Posts To Exerpts

Double check your site & see if there is a line that looks like the following:-


 <?php the_content(); ?>

Replace this with the following:-


 <?php the_excerpt(); ?>

Most templates do have the_excerpt() function, but double check it!

Add tag_description() above the Post Loop

Within the template, above the WordPress Loop, add the following:-


<?php 						if (tag_description() != "")

						{

						echo tag_description();

						} ?>

This will add on a paragraph or two onto the top of the post if there is anything located in the tag_description(). You add things via the “Post Tags” in WordPress’ Admin section.

Do I Have To Add A Tag Description for Every Tag?

No, only your most popular pages. They make great “sneeze pages”. Landing pages that get people looking at a selection of your posts. In the Tag Description, link to a range of your best posts related to that tag.

Thoughts?

Do you use tag descriptions? Say so in the comments!

WordPress 3.1 Released – My Thoughts on it

WordPress 3.1 was released yesterday with a massive fanfare. The fact it’s now a 3.1 release means that there’s significant new features added, rather than just bug fixes.

What’s New?

Although there’s a full list of updates on WordPress’ website, here’s the features I’m most looking forward to:-

  • Internal Linking - Auto target keywords to get links to your best or most relevant posts. I’m really looking forward to this one! It’s something that WordPress has needed for ages, as internal linking is a crucial yet often ignored part of SEO. This makes it a lot easier to manage.
  • Admin Bar - Browsing your blog as an admin allows you to make quick & simple changes via a black bar along the top of the site. I’m not sure if this is a good thing or not, I’ve played with it on You’re Supposed to Be At Home & it blends in with the header navigation too much for my liking. Can you change the colour of it?
  • Post Formats - This is very interesting. Basically, you can have a different style of post depending on what that post is about. A large comment list will display differently from a video. I’m really looking forward to play with this!

Upgrading?

I’ve upgraded (I’m often very cautious and generally wait to x.x.1 release, which spots a few bug fixes & security updates), but noticed that a few people are having problems. Remember to backup before upgrading!

Favourite Parts of the new WordPress?

What’s your favourite parts of the new WordPress? Have you had a play around with Post Formats? If you have, share them in the comments, I’d love to see them!

How To Get Digg Digg & Sexybookmarks To Work With Woothemes Bueno

I’m a huge fan of Woothemes themes, they can be uploaded & installed in seconds, have a nice framework & are able to be edited. I’m also a huge fan of Digg Digg & Sexybookmarks. Unfortunately, when testing with the free theme Bueno by Woothemes with a new blog – You’re Supposed To Be At Home, it lead to this problem with the featured posts section:-

What’s Happening Here?

As the featured section is treated as a separate post cycle, it’s includes whatever is included in the original post cycle, which includes the bookmarks. What we need to do is remove them.

Removing the Sexybookmarks from Featured Posts

To remove the Sexybookmarks from the Featured Posts, what you have to do is make sure that the featured posts feature the excerpt, rather than the content. Simply go to Appearance > Widgets, and change it to the following:-

Removing Digg Digg From The Featured Posts

To remove Digg Digg takes a little bit more work, and edit the actual theme. It’s a bit codey, but it’s straightforward!

1. Open theme-widgets.php file

Firstly you need to open the theme-widgets.php file (after backing it up, of course!). This file is located in the “includes” directory in the theme template (for this I’ll be talking about Bueno, the free Woothemes theme).

2. Edit the_excerpt Loop Using Regex

What we are doing here is editing the excerpt so instead of placing the excerpt on the page, we’ll remove the Digg Digg Links. Luckily the links are all wrapped in a div, so if we find the div using Regular Expression (Regex), we can remove it.

To do this you need to go line 207, which looks something like this:-

if($content == "excerpt") { get_the_excerpt(); }

Replace it with the following code:-

if($content == "excerpt") {
 $ex = get_the_excerpt();
 $ex = preg_replace("/<div class='[a-z_'<> =\/(){.A-Z,1-9[0\];:}?%-^\"!]*<\/div>/", "", $ex);
 echo $ex; }

This should get rid of any of the buttons from the featured posts. If it doesn’t please let me know & I will research further.

Still Stuck?

Contact me & I’ll help you sort this issue out.

Do I Still Like Woothemes?

Absolutely! I’m still a huge fan. The fact that you can dive into the code & edit it is a beautiful thing that many other templates don’t allow you to do easily. As such I’d recommend signing up for them. I’m subscribed to their monthly package, but you can download the themes one off as well. They’re well worth getting for your blog. Check them out!

WooThemes - Made by Designers