最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Walker class conditional based on parent menu item label or custom css class

programmeradmin4浏览0评论

I'm out of my shallow depth here. I'm trying to add html to the end of drop down menus whose parent item is either a specific item label or custom css class that's been added via the WP menu admin.

Any help appreciated. The basics:

public function end_lvl( & $output, $depth = 0, $args = null ) {
    parent::end_lvl( $output, $depth, $args );
    if (/* top-level parent item has [specified label] or [specified css class] */){
       $output .= '<div>See how we can help you <a href="#">Find out more</a></div>';
    }
}
发布评论

评论列表(0)

  1. 暂无评论