Adding Tags to Your Pages in WordPress

Posted in: How To's, Web Development, WordPress

A site that I was working on was using mostly pages in WordPress 2.51 but the owner was very interested in putting tags and a tag cloud on their home page. WordPress doesn’t natively support tags on pages only on posts so I had some homework to do.

I was able to find a plugin called tags4page version 1.1 that I thought might just do the trick. So I downloaded the plugin, installed it and viola I was able to add tags to my pages. There was only one problem though, WordPress was not tallying up the total number of times that tag was used on the pages. Time to roll up the sleeves and dive into the code….

Here is what I came up with:

Open the /wp-includes/taxonomy.php file

at about line 1930 you will find this statement:

remove

AND post_type = 'post'

so the new line should look like this:

About This Site

WDBuc.com is the web site and blog of William D Buchanan, a technology professional in the Tampa, Florida area. More...