Previously we showed you how to Add .first & .last CSS class to WordPress Navigation Menus to help with styling attributes when designing a WordPress theme. Today I though it would be beneficial to follow up that tutorial with one that shows you how to automatically add .first & .last CSS class’s to all WordPress widgets displayed anywhere on your site by adding a simple filter to the wordpress
When designing a WordPress theme you may want to add some .first and .last css classes to your WordPress navigation menus for styling purposes. This tutorial will show you how to acheive that by placing some filter code into your themes WordPress functions.php file that will modify all your menu items through “wp_nav_menu_objects” by adding .first and .last CSS classes allowing you to style menu items easily.
Continue reading “Add .first & .last CSS class to WordPress Navigation Menus”