Broken CSS navigation calls for dynamic body ID
-
Hello there,
Complete wordpress/PHP neophyte here. I’m in the process of “translating” a static xhtml/css website into a wordpress theme, so please bear with me.
Now, my nav menu highlighting relies on each page having its own unique ID within the body tag. Seeing as now I only have one body tag (in my header.php template), my nav menu highlighting is dead.
I have 14 wordpress pages as it stands, and I’ve tried using the following PHP to dynamically spit out my body tag ID. I’m trying to use the page titles for the body tag ids.
<?php if (is_front_page()) { ?> <body id="home"> <?php } else { ?> <body id="<?php echo wp_title; ?>"> <?php } ?>
I repeat, I have no idea how to code in PHP. Can anyone tell me what I’ve done wrong in my code and how to go about fixing it? *_*
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Broken CSS navigation calls for dynamic body ID’ is closed to new replies.