简体   繁体   English

woocommerce在我的帐户的菜单导航上添加字幕

[英]woocommerce add subtitle on menu navigation on my account

i got in stuck with a customization that i want to do on myaccount navigation menu in the Woocommerce account. 我陷入了我想在Woocommerce帐户的myaccount导航菜单上进行的自定义设置的麻烦。

I want to add inside the li tag a subtitle under the menu item name, the item that he get from wc_get_account_menu_items() function, but it doesn't have any subtitle in the $item. 我想在li标签内在菜单项名称下添加字幕,菜单项名称是他从wc_get_account_menu_items()函数获得的项目,但$ item中没有任何字幕。

How can i customize it in order to insert it in the navigation.php 我如何自定义它以便将其插入Navigation.php中

I attach a file where it shows how it have to be rendered 我在一个文件中附加了一个文件,该文件显示了如何呈现该文件

I thought to insert an action at wc_get_account_menu_items in order to add teh subtitle but i can't figure out how :( 我想在wc_get_account_menu_items上插入一个动作,以便添加字幕,但我不知道如何:(

Thank you 谢谢

Mirko 米尔科 导航

You can't get the HTML you required (as per screenshot) using woocommerce_account_menu_items() filter or any other filter. 您无法使用woocommerce_account_menu_items()过滤器或任何其他过滤器来获取所需的HTML(如屏幕截图所示)。

So if you need the same structure, it is better to hard code the links & HTML in your theme by copying navigation.php from wp-content\\plugins\\woocommerce\\templates\\myaccount to wp-content\\themes\\your-theme\\woocommerce\\myaccount . 因此,如果您需要相同的结构,最好通过将Navigation.php从wp-content\\plugins\\woocommerce\\templates\\myaccount复制到wp-content\\themes\\your-theme\\woocommerce\\myaccount ,对主题中的链接和HTML进行硬编码wp-content\\themes\\your-theme\\woocommerce\\myaccount

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM