Custom menu items
-
How do we can add extra custom menu item in the AMP menu using code. Let me know any hooks are available for this. The below filter is not working for AMP.
add_filter( 'wp_nav_menu_items', 'prefix_add_menu_item', 10, 2 ); /** * Add Menu Item to end of menu */ function prefix_add_menu_item ( $items, $args ) { if( $args->theme_location == 'primary' ) $items .= '<li class="menu-item">...</li>'; } return $items; }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Custom menu items’ is closed to new replies.