I'd like to create a dynamic menu with a mix of static pages and custom post type archives that applies a class of "current" to the current tab. The example below uses 1) Static page set as Home 2) Static page 3) Custom post type archive 4) Static page for blog content.
Tried to edit the code from my previous menu, but it's not working. I'd appreciate any assistance!
Thanks.
<ul>
<li<?php if ( is_front_page() ) { echo ' class="current"'; } ?>><a href="/">Home</a></li>
<li<?php if ( is_page('my-page') { echo ' class="current"'; } ?>><a href="/my-page/">My Page</a></li>
<li<?php if ( is_post_type_archive('my-custom') && is_single()) { echo ' class="current"'; } ?>><a href="/my-custom/">My Custom Posts</a></li>
<li<?php if ( is_page('blog') { echo ' class="current"'; } ?>><a href="/blog/">Blog</a></li>
</ul>