Ok, need a wordpress guru ... this will be easy for ya but its
I have a nav menu that I want to highlight based on what page/category
the user is in:
<ul><!-- main navigation -->
<li <?php if(is_home()): ?>class="current_page_item"<?php endif; ?>><a
title="Home page" href="<?php bloginfo('url'); ?>"><span>Home</span></
a></li>
<li <?php if(is_category('Portfolio')): ?> class="current_page_item"<?
php endif; ?> ><a href="/category/portfolio">Portfolio</a></li>
<li <?php if(is_page('Services')): ?>class="current_page_item"<?php
endif; ?> ><a href="/services/">Services</a></li>
<li <?php if(is_category('blog') ): ?>class="current_page_item"<?php
endif; ?> ><a href="/category/blog/">Blog</a> </li>
</ul>
This works great.... EXCEPT when you go into an individual blog entry.
Then no workie. I tried this:
<li <?php if(in_category('blog') ....
but that became true for Home and Services "pages" as well. So finally
I came up with:
<?php if(in_category('blog')&&(!is_page())&&(!is_home()) )
and that worked... but that is lame? Is there a better way? I just
want to understand this stuff with resorting to hackery :p
Thanks
Rob
--~--~---------~--~----~------------~-------~--~----~
Our Web site: http://www.RefreshAustin.org/
You received this message because you are subscribed to the Google Groups
"Refresh Austin" group.
[ Posting ]
To post to this group, send email to [email protected]
Job-related postings should follow http://tr.im/refreshaustinjobspolicy
We do not accept job posts from recruiters.
[ Unsubscribe ]
To unsubscribe from this group, send email to
[email protected]
[ More Info ]
For more options, visit this group at
http://groups.google.com/group/Refresh-Austin
-~----------~----~----~----~------~----~------~--~---