Can I make 'blog' pages act as child pages
-
I am developing a theme which is mostly cms pages. There are 2 levels of menu, top level, and within each parent, there is a menu of child pages which are only displayed if the parent has children. The navigation displays ‘on’ states for both child and parent of the page we are currently on.
One of the child pages is called blog, and this is where I’m building the ‘blog’ part of the site; posts, archives, tags, categories etc. using the standard wp templates to help display them. I created a page, and gave it a custom template to display the initial post list. The menus show the correct ‘on’ state. So far, so good…
The problem is that because the wp files (tag.php, single.php etc.) are outside of the ‘page’ structure, they obviously don’t show in the menu. Ideally what I want is for the ‘blog’ child menu to stay lit when we access any of these pages.
Any ideas as to the best way of achieving this? My first idea is to put the child menu build in a function and while looping, pick up the ‘blog’ item, then see if is_tag, is_single etc. are true and add the ‘on’ class manually. Easier way anyone?
- The topic ‘Can I make 'blog' pages act as child pages’ is closed to new replies.