• Return to Content
  • Home
  • About
  • Member Area
    • WordPress Themes
    • WordPress Plugins
  • Tools & Resources
  • Code Snippets
  • Blog
Main Menu

WP Musketeer

Swashbuckling Online Business with WordPress

  • E-mail
  • Google+
  • RSS
  • Twitter

November 14, 2015

UPDATED TO USE CUSTOM TERM META: Add Description Below Products on WooCommerce Product Category Archive

(For the full post explaining the reasoning behind these code snippets see here.)

Register a “details” field on product category terms

We need to let WordPress know that we’d like to store an extra bit of info along with our product category term data. These extra bits of info are known as meta data, and since we’re adding it to a taxonomy term, WordPress calls this “custom term meta”. It’s very easy to register our new meta field, let’s call it “details”:

Add the details field to the Add New Product Category page

Next, let’s add a text area to the product categories page that will let us enter extra juicy detail about a product category term as we create it. Because this form is quite narrow we won’t make it a full-on WYSIWYG visual editor. We’ll save that for in a moment.

Add a WYSIWYG “details” field to the Edit Product Category page

Next we’ll add the details field to the edit product category page. This time, because we’ve got more space, we’ll use a proper WordPress visual editor. That way you can use headings, blockquotes and include images and other media as if you were editing a page or post.

Save the details field content to the database

We need to save the details field when a product category is first added and after it has been edited.

Display the details field on the category archive page

Filed Under: Code Snippets, WooCommerce

Member Area
  • Privacy Policy
  • Terms and Conditions
  • Sitemap

Copyright © 2023 WP Musketeer · All rights reserved · WP Musketeer is a trading name of Moortor Design Ltd.

Registered in England and Wales · Company number 07951342 · VAT registration number 129768469