• I like the horizontal nav bar at binarybonsai.com. I’m especially interested in getting the current tab to highlight.

    I understand how the CSS works (described in this post) using an ID selector on the body tag. The only thing is, I’m not exactly clear on what PHP I need to use in header.php to get the IDs to be generated automagically. (I assume I don’t need a different header for each page. Everything else is way too elegant for that to be the case.)

    For my purposes, I’m interested in using several tabs for different Pages. Basically, all I need someone to point me to is a function that will give some kind of unique identifier for the current Page, and I can figure out the if/then/else or case/switch or whatever.

    Anyone? Thanks in advance.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter jmweber

    (@jmweber)

    Perfect! Thanks a bunch…

    How would the technique translate into scenarios where you are using WP pages?? There is no physical .php file behind the page for you to add a $thisPage variable.

    Regards

    I haven’t done anything with pages yet for 1.5 so I don’t know if publishing one creates a whole new page, or if it simply provides content to be used withiin a template. You could try adding tthe $thisPage within the content, otherwise you could write a series of if/then statements in the head of the page template and set the variable within the content….will explain when I have a bit more time

    This is the code that I use from photomatt’s website:

    http://photomatt.net/scripts/intellimenu

    it lets you highlite current menus without any problems. I’m currently using it and it works with the pages function.

    read the ala article and swiped matt’s code, but i still can’t get my tabs to highlight.

    i’m using wp 1.5 with a modified kubrick template and linking betweeen the blog home page and several wp-generate Pages.

    any suggestions?

    looks like you can only post content, meaning nothing in the head. my only suggestion would be then to set up a different template for each section in your menu (is that possible?) or to figure out how to pass the variable through a custom field. It took me awhile to get it to work without wordpress involved, so you may not get it for awhile…

    it looks like it has to appear before the <html> tag, and i don’t think you can have an if/then function at the top of your document that depends on a variable later on in your document…let me experiment..

    i just pasted the entire code in my header div and it worked for me.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Highlighting a tab’ is closed to new replies.