简体   繁体   中英

How to add link_after and lin_before class in Wordpress wp_nav_menu?

现在我有一个问题要添加额外的两个span类,像这样

<li id="menu-item-15" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-15"><a href="#"><span class="left"></span>Sample Page<span class="right"></span></a></li>

When you call wp_nav_menu you can supply strings to appear before and after the link text using the 'link_before' and 'link_after' parameters.

wp_nav_menu(array(
  'link_before' => '<span class="left"></span>',
  'link_after' => '<span class="right"></span>'
));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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