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 etcd集群部署问题
  • ¥20 谁可以帮我一下问一下各位
  • ¥15 为何重叠加权后love图的SMD与svyCreateTableOne函数绘制基线表的不一致
  • ¥15 QFILHelper怎么恢复全字库,提示进程已完成,只能恢复分区文件
  • ¥150 求 小魔指游戏板整合模拟软件
  • ¥20 你好,我想问下easyExcel下拉多选,或者复选框可以实现吗
  • ¥20 双非跨考工科哪个专业和方向就业前景好?
  • ¥20 求会6sv辐射传输模型,辅导(可py6s🙏🏻有偿
  • ¥15 .xla后缀的文件拖到excel里什么内容也没有怎么办
  • ¥20 Workbench中Mechanical打不开、闪退是什么原因?