items */ add_filter( 'nav_menu_css_class' , function( $classes, $item, $args, $depth ) { if ( 'navbar-main-menu' === $args->theme_location ) { if (property_exists($args, 'menu_item_class')) { array_push($classes, $args->menu_item_class); } } return $classes; }, 3, 4 ); /** * Filter to add CSS class to navbar menu item links */ add_filter( 'nav_menu_link_attributes' , function( $atts, $item, $args ) { if ( 'navbar-main-menu' === $args->theme_location ) { $atts['class'] = (empty($atts['class'])) ? '' : $atts['class']; if ( in_array('current_page_item', $item->classes) ) { $atts['class'] .= ' active '; } if (property_exists($args, 'link_class')) { $atts['class'] .= ' ' . $args->link_class; } } return $atts; }, 2, 3 ); /** * filter to globally alter the '(more...)' text of the post excertp "read more" link */ add_filter( 'the_content_more_link', function () { return ''; }); /** * custom walker to handle nav main menu dropdowns (one level deep, bs5 doesn't have native submenu support) */ class RDNYC_Menu_Walker extends Walker_Nav_Menu { function start_lvl(&$output, $depth = 0, $args = array()) { $output .= "\n