I'm struggling with applying the wordpress function for a specific screen width. Below is the given php function which I wish to apply for a particular screen width:
function add_specific_menu_atts( $atts, $item, $args ) {
$menu_items = array(4167, 4181, 4359, 4407, 4413, 4423, 4440);
if (in_array($item->ID, $menu_items)) {
$atts['data-toggle'] = 'dropdown';
}
return $atts;
}
add_filter( 'nav_menu_link_attributes', 'add_specific_menu_atts', 10, 3 );
I would really appreciate the much-needed help.