Skip to content
themeforge
EN
Start free
Menu
  1. Home
  2. Attribute reference
  3. wp="term-title"
Core Categories

A category’s name, description and post count

wp="term-title"

Every WordPress category already has a name, a description and a post count. These values show them in the header of the category page: one design, and “Coffee”, “Kitchen” and “Events” each get their own text.

Where it goes

On archive.html: it builds the template WordPress uses to show categories and tags.

wp="term-title" goes on the heading, wp="term-desc" on the block for the description, wp="term-count" on the element with the number of posts.

Example: the header of the “Coffee” category

Markup archive.html
<header class="category">
  <h1 wp="term-title">Coffee</h1>
  <div class="category__lead" wp="term-desc">
    <p>Beans, brewing and the people who roast them.</p>
  </div>
  <p class="category__count"><span wp="term-count">12</span> posts</p>
</header>
In the admin Posts → Categories → Coffee
Name Coffee
Description Beans, brewing and the people who roast them.
Count 14
On the site category page
Coffee

Beans, brewing and the people who roast them.

14 posts

The client changed the category’s description, and the header of its page changed with it.

What matters

  • The name and description are edited in Posts → Categories, on the category itself; WordPress counts the posts.
  • On a <div> the description comes in paragraphs, the way WordPress split it; on a <p> or a heading it is plain text without paragraphs.
  • On pages that are not a category or tag page, these values print nothing.
  • wp="archive-title" prints the name too, but with the WordPress prefix: “Category: Coffee”.

Common mistakes

The build log is the “Logs” tab of your project on themeforge.pro; the free markup check shows the same notes.

Not like this
<h1 wp="post-title">Coffee</h1>

wp="post-title" in the category header: the name is replaced by the title of a post from the list below. The log stays silent.

Like this
<h1 wp="term-title">Coffee</h1>

wp="term-title".

Alternative spelling

wp="term_title" works the same: the build gives an identical theme.

Used in recipes

Ready when you are

See your site’s WordPress admin before you pay.