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

customization - How do I call in a category title on a category page in a child theme?

programmeradmin3浏览0评论

I would like to pull in the Category Title as an H1 tag, but I don't know if it is possible to do without modifying the Parent Theme. For example I would like the category for this page [/][1] to show at the top.

I would like to pull in the Category Title as an H1 tag, but I don't know if it is possible to do without modifying the Parent Theme. For example I would like the category for this page [https://cordialorganics/category/education/][1] to show at the top.

Share Improve this question asked Apr 21, 2020 at 18:45 user2510408user2510408 111 bronze badge 1
  • 1 You'll have to customize your theme. – Himad Commented Apr 21, 2020 at 19:13
Add a comment  | 

1 Answer 1

Reset to default 0

Add a category.php at your child theme. And copy your archive.php.

Use <?php the_archive_title( '<h1>', '</h1>' ); ?> above the post querry.

If you want to add the archive title to all archives, you can directly create an archive.php in your child theme and add the h1 archive-title at your archive.php.

Check <?php the_archive_title(); ?>

发布评论

评论列表(0)

  1. 暂无评论