My Local Project for Getacho Company |
- Menu.php
- Header.php
- Footer.php
<nav class="navigation">
<ul class="sf-menu" style="float:left;">
<li class="active"><a href="index.php">Home</a>
</li>
<li><a href="about.php">About</a></li>
<li><a href="portfolio.php">Portfolio</a>
<li><a href="forums/">Forums</a>
</li>
<li><a href="blog/">Blog</a>
</li>
<li><a href="contact.php">Contact</a>
<ul class="sub-menu main-ul">
<li><a href="support/">Support</a></li>
<li><a href="support/">Live Chat</a></li>
</ul>
</li>
<li><a href="user/">User Panel</a>
<ul class="sub-menu main-ul">
<li><a href="user/seo/">SEO Panel</a></li>
</ul>
</li>
</ul>
</nav>
But here I was getting some problem that how to move class="active" according to static current page.
Then I consulted with my friends and someone suggested me a code. now it is working.
Code was :
<?php
$url = $_SERVER['REQUEST_URI'];
if (strpos($url,'about.php') !== false)
echo 'class="active"';
?>
Here you need to understand STRPOS function.
I used same code in my navigation. Now navigation is working good. Now navigation code is
<div id="menu" class="clearfix">
<nav class="navigation">
<ul class="sf-menu" style="float:left;">
<li
<?php
$url = $_SERVER['REQUEST_URI'];
if (strpos($url,'index.php') !== false)
{
echo 'class="active"';
}
?>
><a href="index.php">Home</a>
</li>
<li
<?php
$url = $_SERVER['REQUEST_URI'];
if (strpos($url,'about.php') !== false)
{
echo 'class="active"';
}
?>
><a href="about.php">About</a></li>
<li
<?php
$url = $_SERVER['REQUEST_URI'];
if (strpos($url,'portfolio.php') !== false)
{
echo 'class="active"';
}
?>
><a href="portfolio.php">Portfolio</a>
<li><a href="forums/">Forums</a>
</li>
<li><a href="blog/">Blog</a>
</li>
<li
<?php
$url = $_SERVER['REQUEST_URI'];
if (strpos($url,'contact.php') !== false)
{
echo 'class="active"';
}
?>
><a href="contact.php">Contact</a>
<ul class="sub-menu main-ul">
<li><a href="support/">Support</a></li>
<li><a href="support/">Live Chat</a></li>
</ul>
</li>
<li><a href="user/">User Panel</a>
<ul class="sub-menu main-ul">
<li><a href="user/seo/">SEO Panel</a></li>
</ul>
</li>
</ul>
</nav>
</div>
Guidance by : Nahyan Shiwani
+ comments + 4 comments
I like the helpful info you provide in your articles.
I will bookmark your weblog and check again here frequently.
I am quite sure I will learn lots of new stuff right here!
Best of luck for the next!
Also visit my page; schwindel übelkeit ()
Thanks friend for it. I welcome you.
Samee Ullah Feroz
you're in point of fact a excellent webmaster. The web site loading speed is incredible.
It sort of feels that you are doing any unique trick.
Moreover, The contents are masterwork. you have performed a fantastic
process in this matter!
Here is my blog übelkeit ()
Thanks. I am not using any trick for website speed. It is Blogger magic. My website is hosted on Blogger. thanks for it.
Post a Comment
Give your reviews about this blog. Leave your comments. what do you think about this post?
Comments Description is given below:
1) I love to read comments, but do not spam.
2) Like this blog and also tweet its posts.
3) You can use some xHTML tags.
4) All Comments are Do Follow, Please try to use blog professionally.
5) Mention Your Name below the comment.
6) You can also suggest for improvement.
7) Do not forget to subscribe Samee Articles blog.
---------------------------------------
Thanks for visiting QWC.Me.
==========================================
For free guidelines contact me on SEO Expert | Samee Ullah Feroz is online there.
==========================================
Best Regards