I am creating a new template that will get all the custom post type (Case Studies) content, including the taxonomies values associated with it.
So far I got the following:
<section>
<h1><?php _e( 'posts', 'casestudies' ); ?></h1>
<?php get_template_part('loop'); ?>
<?php
$args = array('post_type' => 'casestudies', 'posts_per_page' => 3);
$query = new WP_Query($args);
while($query -> have_posts()) : $query -> the_post();
?>
<h2><?php the_title(); ?></h2>
<p>Meta: <?php the_meta(); ?></p>
<p>Excerpt: <?php the_excerpt(); ?></p>
<p>what_to_put_here_to_get_taxonomies_values????</p>
<?php endwhile; ?>
<?php get_template_part('pagination'); ?>
</section>
How do I get the taxonomy of it? I have tried multiple things but all seemed to fail and just getting more confused.
Check this function: wp_get_post_terms()
Assuming your custom post type Case Study supports two taxonomies called country and subject, you can try something like this:
Your output would be something like:
Have you tried using
<?php get_taxonomies() ?>
?If your looking for specific taxonomies that function has optional arguments you can pass in to control the output. See documentation here : http://codex.wordpress.org/Function_Reference/get_taxonomies
Just in case if it could help someone, I used "the_taxonomies()" function inside a loop of a custom post type.
assume: I register a taxonomy with custom post type name publication_category.
On your custom post type template write :