• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2784

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Consultation
  • Full Access
  • Log in

Add Text To WooCommerce Product Category Archive Pages Conditionally

In this post, i’ll show you how easy it is to add some text or any other type of content to one or more WooCommerce product category archive pages.

WooCommerce includes a huge range of hooks which enable you to add extra content anywhere.

On top of this, you can also use the WooCommerce conditional tags in a custom function with any Woo hook to add content.

The 1st method uses a basic custom function which you can add to the end of your child themes functions.php file.

The 2nd method enables you to add different text for each product category and default text for any category not included in the code:

Both solutions enable you to easily change both the:

  • WooCommerce Action Hook – woocommerce_archive_description
  • WooCommerce Conditional Tag – is_product_category()

Related Code

  • Add Text Field To WooCommerce Product Category Archive Pages

WooCommerce

Reader Interactions

Comments

  1. Vicki P says

    September 19, 2014 at 3:28 am

    Hi,
    I am trying to work out how to have the category description show on every page of the products – I have 30 products which goes over 5 pages and the category description only shows on the first page
    Thanks

    Log in to Reply
    • Brad Dalton says

      September 19, 2014 at 1:42 pm

      Use the correct woocommerce hook and conditional tag

      Log in to Reply
  2. Josh says

    September 3, 2014 at 1:02 am

    While adding text via functions.php works, it will make it impossible to edit for anyone you don’t want to give administrator rights to. If you’re handing a site over to a client, you don’t want them messing around in functions.php. There’s a little plugin called Category TinyMCE that adds a WYSIWYG editor to each category page. That would probably be a better option – http://wordpress.org/plugins/categorytinymce/

    Log in to Reply
    • Brad Dalton says

      September 3, 2014 at 8:01 am

      But does it work with custom post types generated by plugins?

      Log in to Reply
  3. aka says

    May 26, 2014 at 7:47 am

    That’s cool. But do you know a way how to add only text when categories are shown?
    If any product is listed, don’t show the category description.

    Log in to Reply
    • Brad Dalton says

      May 26, 2014 at 8:29 am

      Must be a conditional tag for that.

      WooCommerce include a huge range of hooks and conditional tags you can use to modify the default output their plugin generates.

      Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags