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

WP SITES

2662

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

Order Taxonomy Terms By Hierarchy With Separator 4 Ways

This code enables you to control the order of any taxonomy terms in WordPress including categories, tags and custom taxonomy terms for custom posts types.

The code also shows you how to add any type of separator between terms when there’s more than one term without adding the separator after the last term.

Here’s 3 examples of the output showing the parent term, child of parent term and child of child term with 2 different types of separators including, commas, hyphens, arrows and icons ( dashicons ).

Demo Video

Shows 3 different methods to display taxonomy terms names linked and unlinked for your custom post type, tags or categories. In this case, it works with the portfolio custom post type using portfolio-type for the custom taxonomy.

Installation Steps

There’s 2 steps :

  1. # Copy one of the code snippets from the single-portfolio.php file to your child themes functions file, archive template, taxonomy template of single CPT template depending on where you want your terms to output. You can then swap out the name of the taxonomy with your taxonomy name. The default is portfolio-type.
  2.  

  3. # Copy & paste one of the CSS rules to the end of your child themes stylesheet and clear caching.
  4.  

Download Folder

Custom Post Type Taxonomy Terms

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems