Genesis Tutorials

Add Taxonomy Term Slug To CPT Permalink

This download folder includes the code which enables you to dynamically include the taxonomy type term slug to your custom post type permalinks on for single entries.

Example : If your CPT is named HUB and you create a custom type named Blogging, your permalink will change from this :

To this :

Where hub is the name of your custom post type, blogging is your taxonomy term followed by your entry title slug.

The code included in this download :

  • Creates a custom post type named Hub.
  • Creates a custom taxonomy named hub-taxonomy-type which adds support for creating unlimited custom term types from your admin screen.
  • Rewrites your single permalinks to include the custom term the single entry is assigned to.

Demo Video

Shows the term links for a CPT added to the single entry permalinks.

Tested using the Genesis Sample child theme by StudioPress however will work in any Genesis or WordPress theme.

Installation Steps

There’s 2 steps :

  1. # Copy & paste the PHP code from the functions.php file ( excluding the opening PHP tag ) to the end of your child themes functions file.

    Step 1

  3. # Go to Settings > Permalinks in your WordPress Dashboard and Resave your permalinks.

    Step 2

You can then create custom taxonomy terms like these :

Taxonomy terms for custom post type

Download Folder

Leave a Reply

Your email address will not be published. Required fields are marked *