Thematic Taxonomy Template

Working with Custom Post Types can be tricky. Make it easier by using templates to display the taxonomy archive similar to the page.php layout. Copy and paste the content from page.php of your current theme, and remove the section between the content area.

Use this blank section to bring in the content for the post type you’d like to display.



	// calling the header.php


    // action hook for placing content above #container



	<div id="container">


		<?php thematic_abovecontent(); ?>


		<div id="content">



		<ul id="resource_tiles">


	            $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );

		        $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;

		        $args = array(

		            'post_type' => 'resource',

		            'posts_per_page' => 8,

		            'paged' => $paged,

		            'tax_query' => array(array(

			            'taxonomy' => 'type',

			            'field' => 'slug',

			            'terms' => $term->slug // grabs the current term






		        if(have_posts()) : while(have_posts()): the_post();?>



	            		<?php the_post_thumbnail('medium'); ?>

	            		<div class="resource_tile_content">

		            		<?php the_excerpt(); ?>

		            		<p class="resource_date"><?php echo get_the_date('M j, Y'); ?> <span class="resource_icon"></span></p>




	            <?php endwhile; endif; ?>

		</ul><!-- #resource_tiles -->


                </div><!-- #content -->


		<?php thematic_belowcontent(); ?> 


	</div><!-- #container -->


    // action hook for placing content below #container


    // calling the standard sidebar 



    // calling footer.php




Leave a Reply

katherine as a flat graphic icon

About Me

I’m an African / Ojibwe First Nations Web Developer living in Winnipeg, Manitoba.

Visit the Tips and Blog to see what I’m working on.