Adding aLi (or “Lightweight Icons”) class to a WordPress menu allows you to easily create a custom icon menu. To add the aLi class to your menu, open your WordPress theme’s functions.php file and add the following code:
function mytheme_menu() { wp_add_action( ‘wp_menu_items’, ‘mytheme_li_add_item’ ); } add_action( ‘wp_menu_items’, ‘mytheme_li_add_item’ ); function mytheme_li_add_item() { if ( is_admin() ) { $item = new WP_Menu_Item(); $item->name = ‘My Menu Item 1′; $item->description = ‘Description for My Menu Item 1′; $item->tax_class = ‘mytheme_li_tax'; $item->menu_icon = ‘assets/icon-menu-item-1.png'; $item->add_to_menu( ‘primary’, ‘My Menu Item 1′ ); } else { $item = new WP_Menu_Item(); $item->name = ‘My Menu Item 1′; $item->description = ‘Description for My Menu Item 1′; $item->tax_class = ‘mytheme_li_tax'; $item->menu_icon = ‘assets/icon-menu-item-1.png'; $item->add_to_menu( ‘secondary’, ‘My Menu Item 1′ ); } }
To add aLi icons to your menu, simply add the following line to your theme’s functions.php file:
add_action( ‘wp_menu_items’, ‘mytheme_li_add_item’ );
Once the aLi class is added to your menu, you can use the aLi_add_item() function to add an item to the menu.
7 Related Question Answers Found
Adding a class to the menu list in WordPress is easy. To do so, follow these steps:
1. Go to the WordPress administration area and choose “Menu” from the top menu.
2.
Adding a new class to the WordPress menu is easy. First, open up the wp-config. php file in your WordPress install.
Adding a class to a menu item in WordPress is easy. To do so, first find the menu item you want to add a class to. Next, open the menu item’s edit screen (by clicking on the icon in the top right corner of the menu item).
Adding a class to a menu in WordPress is simple. First, open the wp-admin area and click on the menus link in the left-hand column. This will open the menu editor. .
Adding a social menu in WordPress is an easy task. All you need to do is to create a menu item and add the appropriate social media buttons. Once you have done this, you can then add the menu item to your WordPress website.
Adding an active class to a menu in WordPress is relatively easy. All you need to do is create a file called menu-active. php and place it in your theme’s folder.
Adding a tour in WordPress is simple. You simply need to create a custom post type and add a few lines of code. First, you will need to create a custom post type called “Tour.” Then, you will need to add the following code to your custom post type’s functions.php file:.