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

A button that leads somewhere different on each category

tax-link="Field name"

On the “Coffee” category page the button leads to the coffee section of the menu, on “Kitchen” to the dishes. The address is a category field, and the client changes it in the category’s settings.

Where it goes

On an <a> in archive.html: the build replaces its href.

Mark the caption inside with tax-text under another name: “Category button” and “Category button text”.

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

Example: a button in the category header

Markup archive.html
<header class="category">
  <h1 wp="term-title">Coffee</h1>
  <a class="button" href="/menu" tax-link="Category button">
    <span tax-text="Category button text">See it on the menu</span>
  </a>
</header>
In the admin Posts → Categories → Coffee
Name Coffee
Category button /menu#coffee
Category button text See coffee on the menu
On the site category page
Coffee See coffee on the menu

What matters

  • The field keeps the address as text: /menu#coffee, https://….
  • An empty field gives an empty href: fill it in on every category that has the button.
  • The link and its caption have different names, otherwise they are one field.

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
<a href="/menu" tax-link="Button">
  <span tax-text="Button">See it on the menu</span>
</a>

The link and its caption share a name: the build log reports a collision, and one field feeds both the address and the text.

Like this
<a href="/menu" tax-link="Button">
  <span tax-text="Button text">See it on the menu</span>
</a>

The caption is called “Button text”.

Not like this
<div class="button" tax-link="Category button">See it on the menu</div>

Not a link: the address lands on a <div>, and there is nothing to click. The build log says the attribute is on the wrong element.

Like this
<a class="button" href="/menu" tax-link="Category button">See it on the menu</a>

On an <a>.

Alternative spelling

t_link works the same: the build gives an identical theme.

Ready when you are

See your site’s WordPress admin before you pay.