Jump to content
Sign in to follow this  
jbsolutios

Secondary Navigation in Sidebar

Recommended Posts

jbsolutios

Dear All I would like to move the secondary navigation to sidebar 1 (which is on the right) so that it works in the same way that the "PageLines Pro - Grandchild" one does, with the same formatting, box around it etc. Is this possible? I have tried adding a custom menu and selecting this on a per-page basis, but it doesn't achieve what I want. I would like someone to be able to click on a menu item and then see everything which is at the same child level as it, rather than just what is below it. Is this possible please? Thanks

Share this post


Link to post
Share on other sites
Sourena

Create your menu under "Appearance". Then go to "Widgets" and drag and drop "Custom Menu" widget to the widgetized area you want it to appear there. Chhose the menu you want to appear from the drop-down menu in "Custom Menu" widget. bzzvWl.png


alefba.us

Web Development & Design for Right-to-Left languages

Share this post


Link to post
Share on other sites
jbsolutios

This only allows me to have a single menu for all pages though, whereas I need to be able to select a different menu for each page. In addition, it doesn't have any of the nice border or separators which the Grandchild Nav does. It would be great if I could create a Child Nav which showed all items at that page level, along with grandchildren. Is this possible please? Thanks

Share this post


Link to post
Share on other sites
Sourena

To take care of the first issue you need to install a plugin called "Widget Logic". That enables you to specify a certain page for the widget to show up. For the second issue you need to customize the style (CSS) for that widget.


alefba.us

Web Development & Design for Right-to-Left languages

Share this post


Link to post
Share on other sites
jbsolutios

Thanks Sourena, but I don't see how widget logic is going to help? I need to be able to have a different menu for every page at a certain level, e.g. all pages at the Internet level would want to show Broadband, Hosting, VoIP. I just feel that this is a big hole in PP at the moment. If you don't want to use secondary navigation in the header, you are stuck! Can I suggest that as a new feature, you are able to have secondary navigation within the side bars please? Thanks

Share this post


Link to post
Share on other sites
Sourena

You have the secondary navigation within the sidebar. I showed you in the picture how to place it there! It is just a drag and drop. "Widget logic" enables you to show a certain feature on a page (or post or a category archive, etc) and hide it on other pages. You said "I need to be able to select a different menu for each page." "Widget logic"is the solution for that issue.


alefba.us

Web Development & Design for Right-to-Left languages

Share this post


Link to post
Share on other sites
jbsolutios

The Custom Menu only allows you to select a single menu. I have dozens of different menus which I created for secondary navigation. I need to be able to change the menu, depending on the page, not just hide or show it.

Share this post


Link to post
Share on other sites
cmunns

Yes, but that is what widget logic gives you the ability to do.

Share this post


Link to post
Share on other sites
jbsolutios

I can see how I can hide a menu, but how can I tell it to change the custom menu please?

Share this post


Link to post
Share on other sites
jbsolutios

Thanks - can you give me a practical examples please as although I can work out how to determine the page, I don't know how to then tell WP to change the menu? Thanks

Share this post


Link to post
Share on other sites
cmunns

I believe you would just want to add more menu widgets to the sidebar and continue with the widget logic.

Share this post


Link to post
Share on other sites
rapidform2011

We also need a child-level nav like John, and we can do it by making a custom menu in Appearance>Menus. But we have to manually construct these nav menus, as opposed to PP's built in grandchl nav, which conveniently contructs the nav menu for us. Is there a way to have a child nav widget, just like the grandchild nav widget (specifically, that it's automatically created/updated)?

Share this post


Link to post
Share on other sites
rapidform2011

Thanks cmunns & Peter. We're trying both plugins out and we'll see how it goes.

Share this post


Link to post
Share on other sites
kevinlearynet

This function will check if the current page has children, or is a child with siblings, and display the child pages and/or siblings right above the primary sidebar.

/**
	*	List child pages in content area
	*/
	function base_list_children() {
		global $post;
		$page_ID = $post->ID;
		$ancestors = get_post_ancestors($page_ID);
		$children = wp_list_pages("child_of=$page_ID&echo=0");
	
		if( $children ) {
			$parent = $post->ID;
		} elseif ( $ancestors ) {
			$parent = $post->post_parent;
		}
		if( isset($parent) ) {
			$section = get_the_title($parent);
			$childlist = wp_list_pages("title_li=&child_of=$parent&echo=0");
			if( $childlist ): ?>
			<div id="child-pages" class="widget">
				<div class="widget-pad">
					<h3 class="widget-title"><?php echo $section; ?></h3>
					<div class="textwidget sub-nav">
	
	
  • <?php echo $childlist; ?>
</div> </div> </div><!--// end #child-pages --> <?php endif; } } add_action('pagelines_before_sidebar_primary','base_list_children');[/code]

A client liked the sidebar navigation example on RichRelevance.com, this achieves that functionality in a PageLines Pro child theme, just drop it into your [b]functions.php[/b] file.

Share this post


Link to post
Share on other sites
saasagency

Kevin, I used your code and it gave the best results! - Thank you. It is only missing one thing: the style of the grandchild format. I have this screen shot: grandchild.png your code is on top in the left colum and the grandchild style is below it. How can I (and anyone else with this idea) attach the styling of the grandchild to the code your provided? while I am here. It seem like an oversight to not display (prominently) any level of navigation because all navigation is there for good reason and its never filler. so should always be easily visible. my 2cents

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×