doubi6215 2014-11-04 22:50
浏览 54
已采纳

WooCommerce:显示类别名称

Is there a way to display the product category name on the WooCommerce archive-product.php page. My product category name is "Bracelets", and I'd like that to be displayed as a title on the page. I'm using wp_title() currently:

<h1><?php wp_title(); ?></h1>

But that prints it to the page like this:

» Product Categories » Bracelets

I'm getting the parent page title and the catgeory name with separators in between them (above). Is there any way I can get the title to print just "Bracelets"?

Any help with this is appreciated.

Thanks in advance!

  • 写回答

4条回答 默认 最新

  • doulv1760 2014-11-04 23:04
    关注

    You're looking for single_term_title(): http://codex.wordpress.org/Function_Reference/single_term_title

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序