how to create custom post type taxonomy archive template in wordpress

How to create custom post type taxonomy archive template in wordpress? We covered it in our initial article about Custom Post Types, but it wasn’t explained thoroughly. In this article, we will show you a step by step guide on how to create a custom post types archive page or template in WordPress.

First you need to make sure is that your custom post type has archive enabled in the code. To do this, you need to go to your custom post type code (see this article). You need to make sure that you have has_archive argument set to be true. It’s look like url

So now follow our instruction. go to this page How To Create Custom Post Type In WordPress?. Now Take a new php file & give name taxonomy-notices-categories. this name came from your custom post type category register name (taxonomy-registercategoryname.php) & copy and paste below code to your new php template.

Custom taxonomy template code

@package BR Theme- Category
get_header(); ?>

<section id=”wrapper” class=”rony wrapper section category-page <?php single_term_slug(); ?>-category full-width”>
<div class=”main”>
<section id=”content” class=”content grid12″>

<div class=”content-indent”>
<h2><?php echo single_term_title(); ?></h2>
<div class=”notices-archive table-responsive”>
<table class=”notice table”>
<th style=”width:25%”><strong>Title</strong></th>
<th style=”width:40%”><strong>Details</strong></th>
<th style=”width:10%”><strong>Posted Date</strong></th>
<th style=”width:10%”><strong>Download</strong></th>
<?php // Check if there are any posts to display
if ( have_posts() ) : ?>
// Display optional category description
//if ( category_description() ) : ?>
<div class=”archive-meta”><?php //echo category_description(); ?></div>
<?php //endif; ?>
<?php //$counter = 1;?>

// The Loop
while ( have_posts() ) : the_post(); ?>

$adimage= get_post_meta($post->ID, ‘ad_image’, true); ?>
<td><a href=”<?php echo get_the_permalink(); ?>”><?php the_title();?></a></td>
<td><?php the_content();?></td>
<td><?php echo the_time(‘ F j, Y’); ?></td>

<td><a href=”<?php echo $adimage; ?>” target=”_blank”><img style=”border:none;” src=”<?php echo get_bloginfo(‘template_url’).’/images/pdf-icon-red.png’;?>” /></a></td>
<?php endwhile; ?>
<?php else : echo ‘<p>No blog post found.</p>’; endif; wp_reset_query(); ?>

<?php //if(function_exists(‘wp_pagenavi’) ) : wp_pagenavi(); else : paginate(); endif; ?>



<?php get_footer(); ?>

Now it save your theme directory. that’s it, stay connect with us for get more development problem solutions.

One Response to “how to create custom post type taxonomy archive template in wordpress”

  1. I will right away postwholesale nfl jerseys grab your rss feed as I can’t to find your e-mail subscription hyperlink or e-newsletter service. Do you’ve any? Kindly permit me realize so that I could subscribe. Thanks.

​Leave a Comment

Comment authors age:

Facebook Marketing Tips To Promote A Local Business

How to Remove the Cell Spacing in CSS. code for css gap removed