Wordpress Category Navigation–one way to skin a $cat.
My Goal–navigation forward and back in my Web Blog site.
I wanted to display a front splash page which included a little a synopsis of the site’s purpose as well as links to my main or top level Categories.
From any of the Category pages, I wanted the visitor to know location–where she/he was relative to the whole site. I also wanted anyone to be able to drill down into the categories and still retain links from the upper lever categories and never loose the site logo.
Dynamic Category Highlighting in Wordpress 2.1X(?)
I was searching
Wordpress.org for an easy way to assign a unique class or ID to the current-category for formatting reasons. Specifically, to highlight the current category to use as a navigational tool for the site visitor. Wordpress allows “current page” assignment quite easily–without any additional code to your templates, but the searching on wordpress.org came up blank for categories. Well, as such the case with me, I happened to be viewing one of my source files and low and behold!
Wordpress was automatically assigning a current-cat class to the current category. What a great find!
Developing a weblog beyond the default install can present the blog developer / designer with certain dilemmas from time to time.
The wordpress.org site has tons of information. It is sometimes tough finding exactly the “just right” answer or fix to such dilemmas.
Currently, I am working on a site “littlespiderweb.org” which is/will be incorporating both posts and Pages. (For a discussion that distiguishes the difference between a post and a page in a wordpress blog, see
http://codex.wordpress.org/Pages .)
The site’s purpose is to document my NYC trip(s.) My trip planning pages will utilize Pages–not posts. However, I would like to implement the Pages with posts–using them as comments or perhaps reminders to myself. I would also like to use posts as a diary and journal–comments on my thoughts–for my actual trip.
To make a ”seamless” transition between a Page template and a single post template, I decided to try naming post categories that are duplicates to the Main Page titles.
If someone clicks on a link from a Page to a single post, I want to preserve the title of the original Page to use as my search query for the category to display.
These are the links that provide the “how to:”
Update 06/03/06: Apparently, I am not the only one with this idea of using a page name in conjunction with category names so that I could round out the wordpress features. If I find the discussion again, I will post it.
As alluded to in an earlier post, I am trying to fine tune the navigation on my “littlespiderweb.org” site so that both Pages and posts display related content. The first step was to duplicate the name of my parent Pages as categories.
On “littlespiderweb.org,” I decided to organize on a trip by trip basis. So, in addition to naming a Page “May 2006,” I created a category “May 2006″ as well. All my posts for this trip will be put into this category.
The idea is, that when someone visiting the web site clicks on the Page named “May 2006,” the system will not only display a list of all the children pages to “May 2006,” but display a list of all posts in the category “May 2006″ as well.
The templates that I am using to achieve the desired effect is one specific page template that I named “lookingback.php” and the “single.php” template. Both of these templates started out as copies of either home.php or index.php. Both of these templates are identical. The reason for both of course is due to the Wordpress defaults in handling Pages and posts.
Here’s how…