Hello everyone, looking for some help:)
http://69.65.3.168/~doubleop/pro.sperity/blog
is the site i am working on, you can see the navigation is a drop down. I want the green to hover over active pages.
This is a drop down menu, so i created parent pages as the main nav links, and the drop down contains child pages.
All the links are hard coded at the moment, not using wordpress' built in function.
This is my code for the active links, which works well on normal .php sites, but not on wordpress
<ul id="menu">
<li <?php $string = basename($_SERVER['SCRIPT_FILENAME']); if ( strpos($string, 'index') !== false ){ echo "class='active'"; }else{ echo "class='nactive'"; } ?>><a href="http://69.65.3.168/~doubleop/pro.sperity/">Home</a>
<!--No drop downs-->
</li>
<li <?php $string = basename($_SERVER['SCRIPT_FILENAME']); if ( strpos($string, 'blog') !== false ){ echo "class='active'"; }else{ echo "class='nactive'"; } ?> ><a href="http://69.65.3.168/~doubleop/pro.sperity/blog">Blog</a>
<!--No drop downs-->
</li>
<li <?php $string = basename($_SERVER['SCRIPT_FILENAME']); if ( strpos($string, 'business-model') !== false ){ echo "class='active'"; }else{ echo "class='nactive'"; } ?> ><a href="http://69.65.3.168/~doubleop/pro.sperity/business-model">Business Model</a>
<ul>
<li><a href="http://69.65.3.168/~doubleop/pro.sperity/business-model/introduction">Introduction</a></li>
<li><a href="http://69.65.3.168/~doubleop/pro.sperity/business-model/investment-strategy">Investment Strategy</a></li>
<li><a href="http://69.65.3.168/~doubleop/pro.sperity/business-model/investor-benefits">Investor Benefits</a></li>
<li><a href="http://69.65.3.168/~doubleop/pro.sperity/business-model/investment-programs">Investment Programs</a></li>
<li><a href="http://69.65.3.168/~doubleop/pro.sperity/business-model/properity-partnership">Prosperity Partnership</a></li>
<li><a href="http://69.65.3.168/~doubleop/pro.sperity/business-model/rrsp-investment">RRSP Investment</a></li>
<li><a href="http://69.65.3.168/~doubleop/pro.sperity/business-model/limited-partnership">Limited Partnership</a></li>
<li><a href="http://69.65.3.168/~doubleop/pro.sperity/business-model/refferal-program">Refferal Program</a></li>
<li><a href="http://69.65.3.168/~doubleop/pro.sperity/business-model/faq">FAQ</a></li>
</ul>
</li>
<li <?php $string = basename($_SERVER['SCRIPT_FILENAME']); if ( strpos($string, 'track-record') !== false ){ echo "class='active'"; }else{ echo "class='nactive'"; } ?> ><a href="http://69.65.3.168/~doubleop/pro.sperity/track-record">Tack Record</a>
<ul>
<li><a href="http://69.65.3.168/~doubleop/pro.sperity/track-record/company-overview">Company Overview</a></li>
<li><a href="http://69.65.3.168/~doubleop/pro.sperity/track-record/investment-portfolio">Investment Portfolio</a></li>
<li><a href="http://69.65.3.168/~doubleop/pro.sperity/track-record/why-prosperity">Why Prosperity</a></li>
<li><a href="http://69.65.3.168/~doubleop/pro.sperity/track-record/testimonials">Testimonials</a></li>
</ul>
</li>
<li <?php $string = basename($_SERVER['SCRIPT_FILENAME']); if ( strpos($string, 'current-oppertunities') !== false ){ echo "class='active'"; }else{ echo "class='nactive'"; } ?> ><a href="http://69.65.3.168/~doubleop/pro.sperity/current-oppertunities">Current Oppertunities</a>
<ul>
<li><a href="http://69.65.3.168/~doubleop/pro.sperity/current-oppertunities/current-offerings">Current Offerings</a></li>
<li><a href="http://69.65.3.168/~doubleop/pro.sperity/current-oppertunities/ivestor-interest-form">Investor Interest Form</a></li>
<li><a href="http://69.65.3.168/~doubleop/pro.sperity/current-oppertunities/properties-for-rent">Properties for Rent</a></li>
</ul>
</li>
<li <?php $string = basename($_SERVER['SCRIPT_FILENAME']); if ( strpos($string, 'upcoming-events') !== false ){ echo "class='active'"; }else{ echo "class='nactive'"; } ?> ><a href="http://69.65.3.168/~doubleop/pro.sperity/upcoming-events-news">Upcoming Events & News</a>
</li>
<li <?php $string = basename($_SERVER['SCRIPT_FILENAME']); if ( strpos($string, 'mentorship-program') !== false ){ echo "class='active'"; }else{ echo "class='nactive'"; } ?> ><a href="http://69.65.3.168/~doubleop/pro.sperity/mentorship-program">Mentorship Program</a>
</li>
<li <?php $string = basename($_SERVER['SCRIPT_FILENAME']); if ( strpos($string, 'about-us') !== false ){ echo "class='active'"; }else{ echo "class='nactive'"; } ?> ><a href="http://69.65.3.168/~doubleop/pro.sperity/about-us">About us</a>
<ul>
<li><a href="http://69.65.3.168/~doubleop/pro.sperity/about-us/mission-statement">Mission Statement</a></li>
<li><a href="http://69.65.3.168/~doubleop/pro.sperity/about-us/management-team">Management Team</a></li>
<li><a href="http://69.65.3.168/~doubleop/pro.sperity/about-us/contact">Contact</a></li>
</ul>
</ul>
(the code is showing up wierdly, but you get the idea)
I tried echoing out the script_filename, and it was index.php on every page.
Anyone know how i can go about doing this? I need the active state to stay there when the user is on the relevant page, or any relevant child pages within under the parent
Thank you