- This topic is empty.
-
AuthorPosts
-
December 7, 2010 at 12:44 pm #30926
Jacek
MemberI have been asking Mr Google for help but hours spent in front of the screen didn’t solve my problem clearly (by which I mean I’m a beginner and understand simple language only ;))
I have a WP website with a menu at the top (ex. 1, 2, 3, 4)
I would like to have a separate menu (5, 6, 7, 8) when I’m on page 4.Do you know any simple way of going about it? :)
December 7, 2010 at 3:14 pm #70453TheDoc
MemberYou want to change your main navigation when you switch pages? Simply due to usability I highly recommend you not do that.
But perhaps I’m not understanding you correctly! Perhaps you want a sub-navigation to show under it?
December 7, 2010 at 4:39 pm #70432Jacek
MemberYou understand what I mean – I want a different navigation when I switch pages.
To make it clear – it is a page of a local church and I want a subpage for the youth ministry. This is why I want to change the navigation from the main to one connected with the youth only (separate gallery, news, etc.) and still I want it to work under the same domain and layout.
Any ideas?
December 13, 2010 at 3:27 am #69947Jacek
MemberAnd what about a conditional?
December 13, 2010 at 3:29 am #69949Jacek
MemberFor example:
if ( is_page('page_with_second_menu') ) {wp_nav_menu('menu' => 'menu-second-whatever-the-name-is');
}
?>I have come across such things and I’m wondering how to make it work.
December 14, 2010 at 10:43 pm #69859cjk
MemberCustom post types?
That second section could be custom post types yeah?
So, you could set up a custom post type for your youth pages, a “single-type” template for custom posts and then call a custom header.php from that custom post single template that contains the navigation menu.
Whenever a post is made by youth, it will be made on the custom post type “youth” (not page, or post, there will be a new option in the dashboard for “youth” posts or whatever you decide to call it) .
Hope this makes sense to you.
January 18, 2011 at 5:13 am #65437Jacek
MemberIt makes sense but I still have no idea how to go about it ;)
January 19, 2011 at 1:27 pm #65272Jacek
MemberI made it!
1. I added a new menu in functions.php in my theme.
2. Then I created a new template (by simply copying page.php) where I replaced the name of the menu with the new one.
3. Finally using Appearance -> Menu I created a new menu and in widgets I used my new custom menu.Now when I use any page connected with the youth I simply use the template.
That was all I needed and didn’t know it could be that simple :)
Thank you all for your help!
-
AuthorPosts
- The forum ‘Other’ is closed to new topics and replies.