WordPress 面包屑导航用于告诉访客在网站上的位置,此面路径也会显示在搜索结果中有利于 SEO 优化,通常用作辅助导航允许用户在网站的页面层次结构中向上移动,荒岛本次带来 WordPress 自定义类型文章添加面包屑导航的教程,只要将下面的代码添加到主题的「functions.php」文件即可。
- // 荒岛一座藏有宝藏的小岛
- function taxonomy_terms( $product_id, $taxonomy, $args = array() ) {
- $terms = wp_get_post_terms( $product_id, $taxonomy, $args );
- return apply_filters( 'taxonomy_terms' , $terms, $product_id, $taxonomy, $args );
- }
请按「Ctrl+D」收藏荒岛分享给好友,如您发现本文教程或宝藏链接已失效,请联系站长修正!
荒岛公众号
扫一扫关注

HDsoft27
公众号ID已复制,前往微信关注...
荒岛哔哩姬
扫一扫关注

ximagine
哔哩姬ID已复制,前往B站关注...