Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
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? –  Stephen Harris Aug 10 '12 at 0:47
add comment

1 Answer

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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