Amateur webmaster tips: adding Wordpress tags to an old theme

<  Amateur webmaster tips: adding Wordpress tags to an old theme

Since I am upgrading my sites to the wonderful Conundrum/Ad Infinitum/Nosebleed themes, which are not yet compatible with Wordpress 2.3, I had to manually add the (only) feature which I find worth upgrading for: tags. In addition to categories, posts may now be tagged with certain keywords.

Adding to Conundrum/Ad Infinitum/Nosebleed. It is easy to upgrade the Conundrum/Ad Infinitum/Nosebleed themes: currently those themes show the categories in which the posts are put below each post. This is a line that starts with “Posted in”. The corresponding code in the Wordpress theme file is “Posted in < ? php the_category(', ') ? >“. To add tags, simply add the code “< ? php the_tags(); ? >” after the category code, and the tags you have entered for each post will appear like magic!

The files to edit in the Conundrum/Ad Infinitum/Nosebleed themes are index.php, archive.php, search.php and single.php.

Adding a tag cloud in the sidebar. A simple tag cloud can be added by editing sidebar.php and adding the following lines of code:

< ? php if ( function_exists('wp_tag_cloud') ) : ? >
< li >
< h2 >Popular Tags< /h2 >
< ul >
< ? php wp_tag_cloud('smallest=8&largest=22'); ? >
< /ul >
< /li >
< ? php endif; ? >

In the above codes make sure to delete the spaces after “<" and before ">“.

Popularity: 27% [?]

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • Furl
  • Reddit
  • Technorati
Posted in Web development, Wordpress ~ Tags: , , , ~ You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


Leave a Reply

Name (required)
Mail (will not be published) (required)
Website

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


« Amateur webmaster tips: choosing and modifying your wordpress styles

 
Countries in Colors 2006-2008 Some rights reserved | Hosted by GoDaddy |
Powered by WordPress // Template by Mike Lothar // Updated by CiC