Hot answers tagged

2

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 $...


2

Create a new “Custom Link” menu item where the URL is #latestpost (which will act as a placeholder and target for the code). You can title the item whatever you please. This code will then find that menu item (by looking for the placeholder URL) and then replace it’s URL with that of the latest post’s URL. Since the filter is before the code that adds the ...


1

You could set the 'depth' argument to 1 in your wp_nav_menu() call to get only top level items, along with the custom menu walker, something like this: return wp_nav_menu( array( 'menu' => $name, 'menu_class' => 'footer-menu', 'echo' => false, 'depth' => 1, 'walker' => new custom_footer_menu_walker ) ); Add the custom menu walker to your ...


1

This was a color issue I had to fix through the Astra theme's configuration. It was a bit hidden but I found it: Sorry for not mentioning I was using Astra, but I'm basically kinda abstracted from css and html thanks to it, which aren't my specialties.


1

It's a problem in the generated CSS. This rule is adding a color: #fff to your menu links: .ast-theme-transparent-header .main-header-menu .menu-link, You can overwrite this rule in your CSS file and links will be visible. Check it out (the second CSS block): There you go! :)


Only top voted, non community-wiki answers of a minimum length are eligible