How to retrieve depth of menu into template

how to get the relation between the page and the menu item ? = is there a WP function telling this page is linked to this menu item which has or hasn’t a parent Inside the walker, inside the start_el method (which you mentioned), $item->object_id is the page ID. Otherwise, you need to pull the … Read more

custom menu not found

I’m not sure if I’ve followed you correctly; but I think you’re trying to build the Menu HTML entirely on your own. If I’m correct, then what you’re trying to do is covered under “Walker” object of wp-nav-menu. You need to write a separate function in your functions.php and then pass the function name as … Read more

How can I add a class to a single menu item?

In the Appearance > Menus panel, you can expose custom class fields by clicking the “Screen Options” tab at the top of the page. From there, each menu item will have a custom css field labeled “CSS Classes (optional)” where an admin can put any plain text class name.

Get menu item slug

Well you’ve Post ID with you. So you can use this custom function to retrieve slug of any post. function get_the_slug( $id=null ){ if( empty($id) ): global $post; if( empty($post) ) return ”; // No global $post var available. $id = $post->ID; endif; $slug = basename( get_permalink($id) ); return $slug; } This in return will … Read more

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