Don't show icon in custom menu
-
This is a fantastic plugin. I use this plugin for my project. it’s working on wp_nav_menu(). but whenever I use for custom navigation, It’s return an array which hold all thing except menu icon.
Please help me how can I get menu icon.$menu_name = ‘custom_menu_slug’;
if ( ( $locations = get_nav_menu_locations() ) && isset( $locations[ $menu_name ] ) ) {
$menu = wp_get_nav_menu_object( $locations[ $menu_name ] );$menu_items = wp_get_nav_menu_items($menu->term_id);
$menu_list = ‘<ul id=”menu-‘ . $menu_name . ‘”>’;
foreach ( (array) $menu_items as $key => $menu_item ) {
$title = $menu_item->title;
$url = $menu_item->url;
$menu_list .= ‘- ‘ . $title . ‘
‘;
}
$menu_list .= ”;
} else {
$menu_list = ‘- Menu “‘ . $menu_name . ‘” not defined.
‘;
}
// $menu_list now ready to output
- The topic ‘Don't show icon in custom menu’ is closed to new replies.