[wp-hackers] Top level current page navigation

Jeremy Clarke jer-wphackers at simianuprising.com
Mon Dec 1 20:20:36 GMT 2008

As a point of advice on top of everything else, you should try to get
the actual category ID out of your template code. I find that to be
one of the most annoying parts of this kind of control. If you set up
a global variable in your code to hole categories that you want to
give special properties then reference that variable in the functions
it make the whole thing a lot easier to manage. It also makes it
really easy to iterate through all the categories when you're doing
checks, making all your actual code much leaner. When the relevant
categories change you only need to edit one place instead of going
through all your template files looking for mentions of it. By the
same token you should create wrapper functions for this kind of stuff,
which give you more freedom to do complex checking without completely
wrecking the look/formatting of either your template files or your PHP

Jeremy Clarke | http://simianuprising.com
Code and Design | http://globalvoicesonline.org

More information about the wp-hackers mailing list