bear with me here as I explain my problem.
Generated menu via wp_nav_menu, so I have use of the .current_page_item class. The thing is, I've used jQuery to replace the generated link text with some custom images that I have made and I have to use jQuery now to swap out the image so that the button looks "underlined". Now, I've gotten it to work for all of my pages EXCEPT for the Blog page. The Blog page is specified under the Settings > Reading tab, and the Front page = Home, Blog page = Blog.
Here's my jQuery code to try to check if the current page is the blog:
$('#menu-item-75 a').empty()
.append('<img id="blog-btn" src="<?php bloginfo('template_url'); ?>/images/blog-btn.png" />');
// tests if blog page is active, swaps images depending on test result
<?php if (is_page('Blog')) { ?>
$('#menu-item-75 img').attr('src', '<?php bloginfo('template_url'); ?>/images/blog-btn-hover.png');
<?php } else { ?>
$('#menu-item-75 img').mouseenter(function () {
$(this).attr('src', '<?php bloginfo('template_url'); ?>/images/blog-btn-hover.png');
}).mouseleave(function() {
$(this).attr('src', '<?php bloginfo('template_url'); ?>/images/blog-btn.png');
})
<?php } ?>
Any help/tips/advice would be greatly appreciated! Thank you!
* EDIT * Problem hasn't been solved yet, HOWEVER, I think I'm getting close. I tried a few other things:
<?php if (is_page(get_option('page_for_posts'))) { ?> // doesn't work
<?php if (get_option('page_for_posts')) { ?> // WORKS, but leaves menu item underlined all the time instead of only if the blog page is active
How can I test this otherwise, so the blog menu item is only underlined when the page is active?