I have setup a custom post type within Wordpress. For this I have also registered a new taxonomy and added various categories. I then have assigned these to the posts, all of which works, it shows within the post edit etc.

How do I show these on the frontend? Whatever I try it does not work, its like wordpress doesn't know about them. Is there specific code to do this?

  • 1
    Can you share some of the code that you have tried so far?
    – fdsa
    Aug 9 '12 at 16:09
  • Have you created a sample-post for the custom post type in the wp-admin? Where does the 'view post' link leads to?
    – ifdion
    Aug 9 '12 at 21:57
  • Please post the code you used to register your post types & taxonomies. Also, could you clarify: What doesn't appear? Where specifically are you expecting to see it? Aug 10 '12 at 0:47

When you add a custom taxonomy to a WordPress theme, you can display its content using one of WordPress’ taxonomy theme templates

  • taxonomy-{taxonomy}-{slug}.php We could use this to create a theme template for a particular location, such as taxonomy-taxonomyname-termslug.php for the term “boston.”
  • taxonomy-{taxonomy}.php If the taxonomy were location, WordPress would look for taxonomy-location.php.
  • taxonomy.php This template is used for all custom taxonomies.
  • archive.php If no taxonomy-specific template is found, then the taxonomy that lists pages will use the archive template.
  • index.php If no other template is found, then this will be used.

Just make sure you set the post type to your custom post type name on what ever template file you use.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.