Jump to content

Wordpress Navigation Highlighting with custom Navigation.

Recommended Posts

Here is my HTML Navigation menu:

<div id="navigation" >  <ul>   <li><a href="/">Home</a>   <li><a href="services/">Services</a>   <li><a href="portfolio/">Portfolio</a>   <li><a href="about/">About</a>   <li><a href="support/">Support</a>   <li><a href="contact/">Contact</a>  </ul></div><!-- navigation -->

and my navigation CSS

#navigation{    height: 65px;    position:relative;    top:30px;    background: url("images/nav-bg.jpg") repeat-x top left;    border-radius: 4px 4px 0px 0px;    box-shadow: 0px -5px 5px #cb8400;}#navigation ul {list-style: none;}#navigation ul li{float: left;}#navigation ul li a{    color: #999999;    padding: 0px 52px;    font-family: Cambria, Georgia, serif;    font-size:16px;    font-weight:100;    display: block;    height: 60px;    line-height: 60px;    text-decoration:none;}#navigation ul li a:hover{color:#505050;text-shadow:0px -3px 1px #CCC;}

And my website: http://hajzer.info/ how do i make the nav highlight the current page with PHP?

Link to post
Share on other sites

You have to dynamically produce the menu using php, then you can compare with current url address, and then apply active class or id to have it highlighted in some way. IF a simply menu with no submenus you should just think about storing addresses in a array.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...