Category display et al
I have once again found myself playing with WordPress. This time I added support for showing the currently selected category at the top right corner of the content area. Click any categories on the menu and see the results by yourself.
If you are a regular visitor, please update your CSS file by pressing CTRL+F5 (or the required key combination to force reloading all files).
In the same process I also added links to previous and next post into single post pages.
Once again, both these changes required some digging in WP. The next post wouldn’t include > sign inside the link, so I changed the code. Bad solution, but seemingly the only one. The current category was easier, I accidentally spotted proper undocumented function for the job: get_the_category_by_ID(). So I simply added the following code to index.php:
if(isset($cat)) {
echo get_the_category_by_ID($cat);
}
And presto, we have the current category! Add your own HTML code around the function for more formatting.
1. the bomb site weblog » WordPress Category Titles — Monday, Aug 16 2004
[...] “id” to your hearts content in your CSS. Simple really! My thanks to Janne at Nomadig for pointing this one out.
Comments (0) slvShowNewIndicato [...]