modify menu item links dynamically

Can be changed using filter add_filter(‘wp_get_nav_menu_items’, ‘add_utm_to_links’, 10, 3); function add_utm_to_links($items, $menu, $args) { foreach($items as $item) { if(!empty($item->url)) { $item->url .= strchr($url, ‘?’) === false ? ‘?’ : ‘&’; $item->url .= ‘utm=value’; } } return $items; }

Excluding a media query from specific pages

There’s nothing like that with media queries. You need to include the exclusion in your CSS selectors, like this: body:not(.home) .site-header { // etc. } Alternatively, if this is the only CSS in a particular file, you could just not enqueue it on the homepage: add_action( ‘wp_enqueue_scripts’, function() { if ( ! is_front_page() ) { … Read more

how to hide submenus for the not active pages

I use just such a menu in my Oenology Theme. Feel free to use the sidebar menu CSS to suit your needs! Rather than try to post it all here, I’ll just link to the Oenology GitHub repository. EDIT: Here’s where the sidebar navigation menu style definitions start.