Skip to content
themeforge
EN
Start free
Menu
  1. Home
  2. Attribute reference
  3. tax-image
Core Categories

An image of its own for every category

tax-image="Field name"

A cover above the list of posts, an icon in the category menu: WordPress has no image for categories. tax-image adds that field, and the category page shows the image of that very category.

Where it goes

On an <img> in archive.html: the build replaces its src.

For a background image, tax-bg-image on the block, like fld-bg-image.

The field appears in the admin only if the page has a group name: wp-fields-group on its <body>.

Example: a category cover

Markup archive.html
<header class="category">
  <img class="category__cover" src="images/coffee.jpg"
       srcset="images/coffee-p-800.jpg 800w" sizes="100vw"
       alt="" tax-image="Category cover">
  <h1 wp="term-title">Coffee</h1>
</header>
In the admin Posts → Categories → Coffee
Name Coffee
Category cover beans.jpg
On the site category page
beans.jpg Coffee

The client picked a cover on the category; the markup had a different one.

What matters

  • The image’s srcset and sizes are removed, otherwise the browser would show the image from the mockup.
  • alt stays as in your markup, one for all categories: leave it empty on a cover when the category name is right next to it.
  • The image is picked from the media library on each category; “Load data” does not bring it there.

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
<div class="category__cover" tax-image="Category cover"></div>

tax-image on a block with no image: there is nothing to replace, and the build log says the attribute is on the wrong element.

Like this
<div class="category__cover" tax-bg-image="Category cover"></div>

tax-bg-image makes the image the block’s background.

Alternative spelling

t_image 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.