Hi. I'm in the process of making a new theme, but I seem to have a slight issue with wp_list_pages() when viewing a single page (single.php).
You see, I am using the current_page_item css selector to highlight the current page shown in the navigation bar. It works fine when I click my pages, ie. Webdesign, Blog and Profile: the current_page_item is added to the page that's displayed.
But if I for example want to view a blog post displayed by single.php, the current_page_item selector is not applied, and no menu items are highlighted. I would like to still have the current_page_item added to the "Blog" item in the navigation, so when I'm viewing anything that has to do with my blog, the item stays highlighted.
Of course, I could manually create the navigation and define if and when current_page_item should be applied, like so:
<li class="<?php if ( is_page('blog') || is_single() && in_category('blog')) { echo 'current_'; } ?>page_item"><a href="/blog/" title="Blog">My blog</a></li>
- but I would rather use wp_nav_menu, and use only wp-admin if I edit pages, instead of having to edit the template code. Is there any way - either in wp_nav_menu() itself or in functions.php - I can define conditional statements or similar like the above to control current_page_item?
English isn't my native language, so I hope you understand what it is I'm trying to achieve :)