admin管理员组文章数量:1290090
I have a menu, and having hard time to find the menu item and then change the content of it. I only want this single menu after that I continue the rest of the code.
This menu item is page, and I want to plan it if I hover on it, it shows my recent latest post on it. but for now I want to get the hook on how to find this like this in PHP example
$menu[6] = $myCustomHTMLCode
, but on Wordpress, I am having hard time.
for now this is my code. but this is wrong, it added on that last area, and also its not the content when hover is added. Sorry for being not good on wordpress. having hard time learning on the documentation.
add_filter( 'wp_nav_menu_items', 'edit_item_to_nav_menu', 10, 2 );
function edit_item_to_nav_menu( $items, $args ) {
$items .= '<li><a href="#">test</a></li>';
return $items;
}
EDIT 1
I want to duplicate this function on this image, but I don't know how to get the ID of the menu then add the content code on it. I am stuck on the ID cause I having hard time understand the hook in WOrdpress, but in like in normal array in PHP it's only like this $menu[7][$sub_menu] = myCustomHTMLCode
本文标签: plugin developmentHow to change the hover content of a specific menu item on Wordpress
版权声明:本文标题:plugin development - How to change the hover content of a specific menu item on Wordpress? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741445814a2379193.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论