Link to Author archive from Navigation Menus in dashboard?

I don’t really understand why you want to use a menu to control this but it wouldn’t be very hard. First you obviously need a new page template for your grid which you will use get_users to pull your users for display – https://codex.wordpress.org/Function_Reference/get_users Now if you want to control the order and whom is … Read more

Custom Post Types posts as submenus in Nav Menu

Here’s an example on modifying a menu element to add things. In this example, a category item is extended to have a dynamically generated sub menu listing posts, where the menu item has a class of showposts-X where X is the number of posts to show: function menu_show_category_posts( $item_output=””, $item = ”, $depth=””, $args=”” ) … Read more

New post notification in wp_nav_menu

I would store a transient with a life-time of 24 hours when a post (in some category, I’m using category with ID 333 as an example) is published. Whenever subsequent posts are published, the transient is either updated or recreated if 24 hours has elapsed and the transient has been deleted. Logic Whenever a post … Read more

How to get IDs for objects in menu branch?

I am lazy to write supporting logic from scratch so I am reusing functions from linked answer on branches: /** * Retrieve IDs of posts in branch of menu. * * @param mixed $menu * @param string $branch_title * * @link http://wordpress.stackexchange.com/questions/2802/display-a-portion-branch-of-the-menu-tree-using-wp-nav-menu * * @return array */ function get_post_ids_from_menu_branch( $menu, $branch_title ) { $menu_object = … Read more

How do I add a search box to the nav menu?

Your code works perfectly for me as is. The only thing I can think of is that you have a searchform.php defined in your theme but it’s empty? (If searchform.php doesn’t exist in your theme, WP will use a default form.)

Display only page specific sub menu items using Custom Walker

Here is a much simpler implementation: class UL_Submenu_Walker extends Walker_Nav_Menu { private $hidden = false; function start_lvl(&$output, $depth) { if($depth == 0) { $style = $this->hidden ? “” : “display:none;”; } $output .= “<ul class=\”submenu-“.$depth.”\” style=””.$style.””>”; } function start_el(&$output, $item, $depth, $args) { $class_names = $value=””; $classes = empty( $item->classes ) ? array() : (array) … Read more

Calling the Menu Title within wp_nav_menu array function

You can not get the menu title using wp_nav_menu(), you need to get the menu object as follow: //Change with the ID of your menu $menu_ID = 5; $nav_menu = wp_get_nav_menu_object( $menu_ID ); // then echo the name of the menu echo $nav_menu->name; With the above code, you can insert the menu name in wp_nav_menu() … Read more

register_nav_menus() won’t register menus

You don’t need to add any action to register your Nav Menu. Here are some quick steps for you to get your WordPress Nav Menu to work… Register Nav Menu if (function_exists(‘register_nav_menu’)) { register_nav_menu(‘header_menu’, ‘Header Menu’); } Define and Use Nav Menu in your Theme: Usually we place the Menu DIV code in header.php file; … Read more

WordPress Shortcode in Menu Item Title

First of all download ‘Shortcodes in Menus’ plugin and install/activate it. Then in theme’s function.php add following code. add_shortcode( ‘current-username’ , ‘ss_get_current_username’ ); function ss_get_current_username(){ $user = wp_get_current_user(); return $user->display_name; } Now, in menu’s navigation lable write [current-username] shortcode. Same thing you can do for displaying avatar. This way it will display logged in user … Read more