- //向菜单中添加分类自定义值
- function be_header_menu_desc( $item_output, $item, $depth, $args ) {
- if( 'header-menu' == $args->theme_location && get_option('thumb-'.$item->object_id) )
- $item_output = str_replace( $args->link_before . '</a>', '<img src="'.get_option('thumb-'.$item->object_id).'" alt="'.$item->title.'">'.$args->link_before.'</a>', $item_output );
- return $item_output;
- }
- add_filter( 'walker_nav_menu_start_el', 'be_header_menu_desc', 10, 4 );
WordPress向菜单中添加分类缩略图
标签:
如需转载,请注明出处:https://salongweb.com/wordpress-menu-category-thumb.html
加载中…
wordpress自定义域函数get_post_custom_values多个值循环
WordPress MU多站点设置子站点上传路径和文件的URL地址
WooCommerce 通过woocommerce_cart_item_thumbnail钩子修改购物车缩略图
WordPress 管理面板中禁用主题和插件编辑器
WordPress MU多站点解决Timthumb.php不显示缩略图
WordPress循环中判断为每篇文章设计不同的样式
WordPress 功能函数—— activate_plugins(激活多个插件)
WordPress前台登录函数wp_login_form的用法
WordPress 功能函数—— add_clean_index(向指定的表添加索引)
WordPress 自定义的评论查询类 WP_Comment_Query 参考文档和使用实例
禁用管理员通知『连接您的店铺到 WooCommerce.com 接受扩展更新和支持』
WordPress 主题感染恶意代码function _check_active_widgets
加载中…
