Clicky

  1. Home
  2. Developer Docs
  3. Theming (AMP Theme Framework)
  4. Create Custom Template for post type and taxonomy in the AMP Theme Framework

Create Custom Template for post type and taxonomy in the AMP Theme Framework

An explanation for custom templating for developers. These template supports are available on:

Note: This Tutorial will work only with  AMP Theme Framework.
Taxonomy: taxonomy.php
taxonomy-$taxonomy-{$slug_decoded}.php
taxonomy-$taxonomy-{$term->slug}.php
taxonomy-$taxonomy.php

Category: category.php
category-{$slug_decoded}.php
category-{$category->slug}.php
category-{$category->term_id}.php

Tag: tag.php
tag-{$slug_decoded}.php
tag-{$tag->slug}.php
tag-{$tag->term_id}.php

Archive: archive.php
archive-{$post_type}.php
Post type archive
archive-{$post_type}.php

Single: single.php
single-{$object->post_type}-{$name_decoded}.php
single-{$object->post_type}-{$object->post_name}.php
single-{$object->post_type}.php

Page: page.php
page-{$pagename_decoded}.php
page-{$pagename}.php
page-{$id}.php

Author: author.php
author-{$author->user_nicename}.php
author-{$author->ID}.php

archive-{post_type}.php
single-{post_type}.php

archive-{post_type}.php
If your custom post type were ‘product’, and/or query_var = “product”, AMP Framework would look for archive-product.php to display the archive of posts.

For more details check in WordPress template hierarchy

single-{post_type}.php
If your custom post type were ‘product’, and/or query_var = “product”, AMP Framework would look for single-product.php to display the single or permalink of the post.
Its Support single-{post_type}-{post_name_slug}, single-{$object->post_type}

For more details check in WordPress template hierarchy

For taxonomy also similar like: taxonomy-{taxonomy}-{slug}.php, taxonomy-{taxonomy}.php

Note: This might also work with design1, design2, design3  but it’s untested..

Ask your Questions Directly!
If you can't find the solutions in this article, then just ask us in the comments and we will answer it for you!
Updated on April 2, 2019

Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support

Leave a Comment