Title: Highlighting a tab
Last modified: August 18, 2016

---

# Highlighting a tab

 *  [jmweber](https://wordpress.org/support/users/jmweber/)
 * (@jmweber)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/highlighting-a-tab/)
 * 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](http://wordpress.org/support/topic.php?id=24351#post-140916))
   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)

 *  [amory](https://wordpress.org/support/users/amory/)
 * (@amory)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/highlighting-a-tab/#post-157754)
 * [http://www.alistapart.com/articles/keepingcurrent/](http://www.alistapart.com/articles/keepingcurrent/)
 *  Thread Starter [jmweber](https://wordpress.org/support/users/jmweber/)
 * (@jmweber)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/highlighting-a-tab/#post-157795)
 * Perfect! Thanks a bunch…
 *  [Cypher](https://wordpress.org/support/users/cypher/)
 * (@cypher)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/highlighting-a-tab/#post-157798)
 * 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
 *  [amory](https://wordpress.org/support/users/amory/)
 * (@amory)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/highlighting-a-tab/#post-157801)
 * 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
 *  [lawtai](https://wordpress.org/support/users/lawtai/)
 * (@lawtai)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/highlighting-a-tab/#post-157805)
 * This is the code that I use from photomatt’s website:
 * [http://photomatt.net/scripts/intellimenu](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.
 *  [barney06](https://wordpress.org/support/users/barney06/)
 * (@barney06)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/highlighting-a-tab/#post-157818)
 * 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?
 *  [amory](https://wordpress.org/support/users/amory/)
 * (@amory)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/highlighting-a-tab/#post-157826)
 * 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…
 *  [amory](https://wordpress.org/support/users/amory/)
 * (@amory)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/highlighting-a-tab/#post-157827)
 * 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..
 *  [lawtai](https://wordpress.org/support/users/lawtai/)
 * (@lawtai)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/highlighting-a-tab/#post-157858)
 * 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.

 * 9 replies
 * 5 participants
 * Last reply from: [lawtai](https://wordpress.org/support/users/lawtai/)
 * Last activity: [21 years, 2 months ago](https://wordpress.org/support/topic/highlighting-a-tab/#post-157858)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
