Show just one level of child pages, wp_list_pages woe

This should work, using nothing more than the available argument-array parameters for wp_list_pages(): specifically, depth and child_of. To display one level of hierarchy, for descendant pages of the current page: <?php // Globalize the $post variable; // probably already available in this context, but just in case… global $post; wp_list_pages( array( // Only pages that … Read more

WordPress Menu Custom Walker Class

The easiest way is to extend the Walker_Nav_Menu class rather than the Walker_Class, (as the parent / ID fields are set and often you want to maintain some of the mark-up etc). The main methods are: start_el / end_el – responsible for displaying an element in a list start_lvl / end_lvl – responsible for displaying … Read more

adding some custom html code to the wp_nav_menu function

To add that last list item, you don’t need a custom Walker. There is a hook that will allow you to tack that on. function add_last_nav_item($items) { return $items .= ‘<li><a href=”#myModal” role=”button” data-toggle=”modal”>Contact</a></li>’; } add_filter(‘wp_nav_menu_items’,’add_last_nav_item’); It wouldn’t be start_el and end_el that you’d need to edit anyway. Those generate the individual list items. It … Read more

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.)

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)