/ Published in: PHP

Use this function to filter your first and last menu items and assign them each a specific class name. This is very handy when applying separators in CSS but want to exclude the first and/or last items.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// Assign Unique Classes To First And Last Menu Items function first_last_class( $items ) { return $items; } add_filter( 'wp_nav_menu_items', 'first_last_class' );
Comments
