JC Submenu plugin allows you to automatically populate your navigation menus with custom post_types, taxonomies, or child pages.
JC Submenu plugin allows you to automatically populate your navigation menus with custom post_types, taxonomies, or child pages. An easy to use plugin created to be a lightweight menu extension.
Also output a selected section of your dynamic menu through our advanced submenu widget.
For further documentation on installing and using JC Submneu features can be found here.
** What is a WordPress Split Menu **
A WordPress Split Menu is the process of creating a multi level menu, and displaying a menu section relative to the currently viewed object/page. For Example if a site has the following menu and pages:
`
Page 1
– Page 1.1
– Page 1.2
Page 2
– Page 1.3
`
Creating a split menu section for this example, you would set the start depth of 1, this means that when you are viewing any page or child page of Page 1 the split menu would output related items only:
`
Page 1
– Page 1.1
– Page 1.2
`
and if you were viewing any page or child page of Page 2 the split menu section would be:
`
Page 2
– Page 1.3
`
** WordPress Split Menu Widget **
JC Submenu plugin comes with a widget titled “Split Menu Widget” which allows you to output your split menu within a wordpress sidebar.
It is located under Appearance > Widgets in your wordpress administration area.
Widget Settings:
** Split Menu Action **
JC Submenu plugin comes with a built in wordpress action to easily output a split menu anywhere within your theme.
`
`
** Menu Section Widget **
JC Submenu plugins comes with a widget titled “Section Menu Widget” which allows you to output a section of your wordpress menu within a sidebar.
It is located under Appearance > Widgets in your wordpress administration area.
Widget Settings:
** Menu Section Action **
JC Submenu plugin comes with a built in wordpress action to easily output a section of a menu anywhere within your theme.
`
`
** Menu Section Shortcode **
Display a section of your wordpress menu within your visual editor using wordpress shortcodes.
`
[jcs_menu_section menu=”” hierarchy=”1″ start=”1″ depth=”5″ show_parent=”0″ /]
`
JC Submenu WordPress plugin takes the hassle out of creating menus, by removing the manual addition of items and allowing you to automatically populate menu items from posts, categories, tags, custom post types, and taxonomies.
Each with many customisable options allowing you to refine your final menu.
** Enabling Automatic Menu Population **
Once you have the JC Submenu installed, from the menus section
** Populate WordPress Menus with Posts **
* Post Type – Make sure Post is selected from from the drop down labelled Post Type
* Taxonomy – If you wish to only show posts from a certain category/taxonomy choose the appropriate taxonomy from the drop down labelled Taxonomy (otherwise choose All), If you wish to filter it down further by choosing a term within that taxonomy choose the appropriate term from the drop down labelled Terms.
* Order – Choose which field you want to order and how you’d like it ordered Ascending or Descending.
* Post Limit – Setting the number of posts to display, Set to 0 if you wish not to have a limit.
** Populate WordPress Menus with Taxonomies **
* Taxonomies – Choose the taxonomy from the drop down you wish to populate from.
* Order – Choose which field you want to order and how you’d like it ordered Ascending or Descending.
* Hide Empty Terms – Hide terms that do not have any posts / custom posts.
** Populate WordPress Menus with Child Pages **
* Parent Page – Choose the parent page to fetch the child pages.
* Order – Choose which field you want to order and how you’d like it ordered Ascending or Descending.
** jcs/menu_item_args **
jcs/menu_item_args filter is used to edit wp_nav_menu options on a per menu item basis allowing a truely customizeable menu output.
Example – Display Menu Item Image
This example shows how to add an image before a menu item depending on that items object type.
`
add_filter( ‘jcs/menu_item_args’, ‘jcs_menu_item_args’, 10, 2);
function jcs_menu_item_args($args, $item){
switch($item->object){ case 'page': // add blue 10 pixel image before the menu item name $args->link_before = '<img alt="" src="http://placehold.it/10x10/0000FF" />'; break; case 'term': // add green 10 pixel image before the menu item name $args->link_before = '<img alt="" src="http://placehold.it/10x10/00FF00" />'; break; case 'post': // add red 10 pixel image before the menu item name $args->link_before = '<img alt="" src="http://placehold.it/10x10/FF0000" />'; break; } return $args;
}
`
** jcs/item_classes **
Add extra classes to menu items containing their item type.
`
add_action( ‘jcs/item_classes’, ‘jc_edit_item_classes’, 10, 3 );
function jc_edit_item_classes($classes, $item_id, $item_type){
$classes[] = "item-$item_type"; return $classes;
}
`
** jcs/item_title **
Display the dynamic menu type at the end of the item title.
`
add_filter(‘jcs/item_title’, ‘jc_edit_item_title’, 10, 3);
function jc_edit_item_title($title, $item_id, $item_type){
if($item_type == 'term'){ $title .= ' (term)'; }elseif($item_type == 'page'){ $title .= ' (page)'; }else{ $title .= " ($item_type)"; } return $title;
}
`
JC Submenu allows you to disable its custom menu walker making it compatible with themes which uses there own menu walkers.
To enable compatability with other menu walkers add the following code into your themes functions.php file.
`
// enable compatibility with theme custom menu walkers
add_filter(‘jcs/enable_public_walker’, ‘jc_disable_public_walker’);
function jc_disable_public_walker($default){
return false;
}
`
0.9.1
0.9.0
0.8.6
0.8.5
0.8.4
0.8.3
0.8.2
0.8.1
0.8
0.7.2
0.7.1
0.7
0.6.2
0.6.1
0.6
0.5.5
0.5.4
0.5.3
0.5.2
0.5
0.4.1
0.4
0.3
0.2