Can’t assign menu parent id or menu item breaks

Update Solution was easy I’m stupid I just tweaked the menu creation and directly assigned the parent-menu-id: if (!empty($term->parent) && $term->parent != 0) { $parent_menu_item_id = get_parent_menu_item_id_by_name($term->parent, $menu_id); if ($parent_menu_item_id) { $menu_item_id = wp_update_nav_menu_item($menu_id, 0, array( ‘menu-item-title’ => $term_name, ‘menu-item-object-id’ => intval($term_id), ‘menu-item-object’ => ‘product_cat’, ‘menu-item-type’ => ‘taxonomy’, ‘url’ => get_term_link($term), ‘menu-item-parent-id’ => $parent_menu_item_id, ‘menu-item-status’ … Read more

WordPress walker add class to Sub Menu a href

There are special filters for adding classes to the ul, li, or a tags in a menu. For the a tags you want to use nav_menu_link_attributes. This allows you to modify all attributes on the a tag, so here’s an example: function my_nav_menu_link_attributes( $atts, $item, $args ) { if ( ‘main’ === $args->theme_location ) { … Read more

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