Hiding tags and categories in posts

Posted on July 31, 2008 by

11


Posted by Richard
About a month ago-ish, WordPress.com updated all themes at so that they displayed tags on the posts, although they did not actually announce it on the wordpress.com blog until today, July 31. Prior to the theme updates, there were several themes that did not display tags, and some that did not display tags nor categories on the posts. For some, this was the reason they chose a particular theme.

taggingAt WordPress.com, tags and categories that are displayed on the posts lead to the WordPress.com global tags pages when clicked, while tags and categories listed in the sidebar widgets lead to the local blog posts.

Many do not like the fact that the tag and category links on the blog post lead off of their blog, and it has resulted in some rather heated discussions in the WordPress.com forums. Others object simply for aesthetic reasons believing they simply detract from their blog. Others of course are happy about the change.

manpullinghairout1

manpullinghairout1

The ability to hide the tags and/or category display is theme dependent, and will require the WordPress.com paid CSS upgrade and at least some understanding of CSS and some editing experience is highly recommended since there is no official support for CSS upgrades at WordPress.com.

In addition, the name of the CSS selector which controls the display of the tags and/or categories will vary from theme to theme and you will have to do some investigation to figure out where it is. (As an example in Pressrow, the display and style of categories and tags are controlled by p.tagged, in Andreas09, it is .category, in ChaoticSoul it is .metadata, and in Mistylook it is #content .post-info.)

unhappycrowd

unhappycrowd

In some themes, it may be that all post metadata (title, author, date, categories and tags) are controlled together so there may not be anyway in some themes to turn off only the display of categories and/or tags (example: Contempt tags/categories are under .postmetadata, but that also includes the author so hiding the tags and categories also hides the post author, and in Digg3 it is .postinfo but that also controls the display of the author and post date). If you are using Firefox as a browser, there are a couple very useful add-ons that can help you quickly determine how your tags and/or categories are controlled in your CSS: Aardvark and Firebug.I have both installed in Firefox and use them quite often, but prefer Firebug since it has more capabilities.

Some final notes on the CSS upgrade

WordPress.com has provided a preview function that will let you try out the CSS changes you wish to make to see if they actually are going to do what you want them to do without having to pay for the CSS upgrade.

(1) First off, when testing things out, you will want to view the CSS stylesheet for your theme and copy it out and into a plain text editor for reference. You can view the CSS stylesheet in your browser by clicking on the “CSS stylesheet” link on the design > edit CSS page in the dashboard.

(2) Do not paste the entire CSS stylesheet into the CSS editing area. You will only want to include the additions and/or changes you are actually making.

(3) You will also want to have “add to existing style sheet” selected when you preview your changes. This way you do not have to reinvent the wheel so to speak. You’re changes and additions will be added to the bottom of the existing stylesheet which will override the like sections of the original stylesheet.

(4) To preview your changes after you have put them in the edit area, all you have to do is click the preview button at the bottom of the page.

The following is an example of what you would put into the CSS edit area to turn off the display of the categories and tags for the Andreas09 theme:

.category {
display: none;
}

Related posts found in this blog:
WordPress Blogging Tips: Categories and Tags
WordPress.com tagging tips: Don’t be a spam-dexer

add to del.icio.us :: Add to Blinkslist :: add to furl :: Digg it :: add to ma.gnolia :: Stumble It! :: seed the vine :: reddit :: furl :: TailRank