Hello!
I'm trying to get this menu to work on my custom theme:
The menu links are hardcoded into the header.php template. As you can see I use 'Home' one page and four categories. Here's the code I have tried to use:
<ul>
<?php if(is_home() && !is_paged()){ ?>
<!-- li>
<a class="current"href="<?php echo get_settings('home'); ?>" title="You are Home">Blog Navigation</a>
</li -->
<?php } else { ?>
<li>
<a href="<?php echo get_settings('home'); ?>" title="Click for Home">Home</a>
</li>
<?php } ?>
<li>
<a <?php
if (is_category('Photography') || in_category('27') && !is_single())
{
echo " class=\"current\"";
}?> href="<?php bloginfo('url') ?>/category/photography">Photography</a>
</li>
<li>
<a <?php
if (is_category('The Interweb') || in_category('25') && !is_single())
{
echo " class=\"current\"";
}?> href="<?php bloginfo('url') ?>/category/the-interweb">The Interweb</a>
</li>
<li>
<a <?php
if (is_category('Motorsport') || in_category('24') && !is_single())
{
echo " class=\"current\"";
}?> href="<?php bloginfo('url') ?>/category/motorsport">Motorsport</a>
</li>
<li>
<a <?php
if (is_category('Everything Else') || in_category('28') && !is_single())
{
echo " class=\"current\"";
}?> href="<?php bloginfo('url') ?>/category/everything-else">Everything Else</a>
</li>
<li>
<a <?php
if (is_page('Contact'))
{
echo " class=\"current\"";
}?> href="<?php bloginfo('url') ?>/contact">Contact</a>
</li>
</ul>
Issue 1:
When on the homepage the 'Motorsport' link is highlighted.
Issue 2:
When on the contact page the 'Everything Else' link is highlighted.
Issue 3:
If you click though to a single post the menu loses it's highlighting.
Has anyone tried something like this before? or do you have any ideas how I can make this work???
Looking forward to hear your response...
Cheers,
Rich