Responsive Dropdown Menu

Ok… So, after some poking around, I got something to work. I basically combined the menu I found here: https://webdesignerhut.com/css-dropdown-menu/ with the responsiveness of my original menu. The final code looks like… The JavaScript: <script> /* Toggle between adding and removing the “responsive” class to topnav when the user clicks on the icon */ function … Read more

Add data-track to links in menu

So there’s actually a filter for this, provided your theme doesn’t use its own menu walker class: function add_data_track_attribute( $atts, $item, $args ) { $title = apply_filters( ‘the_title’, $item->title, $item->ID ); // $title = sanitize_title($title); // if you need a slug-like title $atts[‘data-track’] = ‘navigation|click|’.$title; return $atts; } add_filter(‘nav_menu_link_attributes’, ‘add_data_track_attribute’, 10, 3); Note the commented-out … Read more

show a hidden ul if li is active

You can achieve this with a simple JQuery selector. $($(‘.active’).parent(‘ul’).get(0)).css(‘display’, ‘none’); We are selecting the parent UL where we find the active class and hiding the element via css. https://jsfiddle.net/0voxj6fp/

Enable identical menu on network sites

Worked it out. Assuming using a theme which has a menu location called ‘primary’, and you have just created a menu with an id contained in $menu_id $menu_locations = get_nav_menu_locations(); $new_menu_locations = array_map( ‘absint’, [‘primary’ => $menu_id]); $menu_locations = array_merge( $menu_locations, $new_menu_locations ); set_theme_mod( ‘nav_menu_locations’, $menu_locations ); This is pretty much exactly how WordPress itself … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)