How to add a custom item to a specific WordPress menu item position

后端 未结 4 1347
北荒
北荒 2020-12-30 16:48

I have a primary menu registered and displayed that consists of 4 links (home, about, news, blog). I want to add html (a logo) in between the second and third menu and I was

4条回答
  •  一整个雨季
    2020-12-30 17:35

    function add_admin_link($items, $args){
        if( $args->menu_id == 'header_menu' ){
            $items .= '';
        }
        return $items;
    }
    add_filter('wp_nav_menu_items', 'add_admin_link',20,2);
    

提交回复
热议问题