Add-On: Advanced Permalinks

The Pods Pro Advanced Permalinks add-on allows you to set up a custom permalink structure for a post type’s taxonomies. This will show all posts based on each taxonomy.  The add-on also gives an optional Taxonomy General Landing Pages to use for custom templating.

Requirements

Requires WordPress 5.5+, Pods 2.7+, and PHP 5.6+

What does this add-on do?

The use-case this add-on was built for is a site that has shared taxonomies between post types. This add-on handles term permalinks for each taxonomy to provide landing pages on each post type. Only posts on that post type which match that specific term will be shown.

Here is the configuration for the purposes of this example:

  • Post type 1: Books (at /books/{book}/)
  • Post type 2: Movies (at /movies/{movie}/)
  • Shared Taxonomy: Genre (at /genre/{genre}/)
  • Taxonomy landing page: Books with Genre (at /books/genre/{genre}/)
  • Taxonomy landing page: Movies with Genre (at /movies/genre/{genre}/)

Taxonomy landing pages

Example: /books/genre/{genre-name}/

Show all posts for a post type with a specific term.

Templating:  You can get which taxonomy is active from the query variable  pods_pro_ap_terms_tax. These permalinks are treated like post type archive pages and will use the associated post type archive templating.

  • Pods Admin > Edit Pods > Edit the post type (for example: Books)
  • Go to the Pods Pro Advanced Permalinks tab
  • Set the Taxonomy landing pages value to have the taxonomy (for example: Genre) checked
  • Save the pod
  • You should now see term links while on that post type (ex. Book) automatically link to the taxonomy (ex. Genre) landing page

Taxonomy General Landing Pages

Example: /books/genre/

This option allows the ability to have a unique landing page per taxonomy that you can template to fit your needs. These pages show ALL posts for a specific post type — this is to help create a template for your taxonomy pages but does not do the taxonomy filtering.

Templating: You can find which taxonomy the landing page is active for by using the query variable pods_pro_ap_terms_tax. You can target this page when you are templating by checking if the query variable pods_pro_ap_terms_all is “1”.

  • Pods Admin > Edit Pods > Edit the post type (for example: Books)
  • Go to the Pods Pro Advanced Permalinks tab
  • Set the Taxonomy General Landing Pages value to have the taxonomy (for example: Genre) checked
  • Save the pod
  • You should now be able to see your Taxonomy General Landing Pages for that post type (ex. Book) and taxonomy (ex. Genre)

Troubleshooting 404s

If you see 404’s on the landing page URLs: Go to Settings > Permalinks and click “Save Changes” to initiate a flush of the rewrite rules that support this feature.