Wordpress menu items without links (like plain text without links)

I am looking for an option to list all menu items in a specific menu without links. I stumbled upon wp_get_nav_menu_items () but can't seem to find the slug menu

http://codex.wordpress.org/Function_Reference/wp_get_nav_menu_items

If someone can help me do this using the menu / menu name, I would really appreciate it

0
source share
1 answer

You can find "menu slug" in the header.php or functions.php file.

Method 1 : Locate the header.php file

open the theme folder and find the header.php file. There will be a line in this file similar to this:

<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?> 

Here primary is the name of your menu.

Method 2: Look into the functions.php file.

If you have defined several menus, you should check inside the functions.php file.

In this file you can find a line similar to this:

 register_nav_menu( 'primary', __( 'Primary Menu', 'twentyeleven' ) ); 

Here primary is the name of your menu.

Hope this helps you.

0
source

Source: https://habr.com/ru/post/910747/


All Articles