OK, so I managed to do this by creating a new archive page for the Custom Post Type (CPT) named ‘archive-micropost.php’ and it seems to be working well. ‘micropost’ is the name of the CPT.
Now I am just trying to create a slightly different single post page for the same CPT and have created a ‘single-micropost.php’ file for the theme, which is almost working correctly, except that the content of the post is not showing up.
Here’s what I’ve got:
<?php get_header(); ?>
<div <?php post_class(); ?>>
<article>
<?php do_action( 'post_before' ); ?>
<?php ct_period_featured_image(); ?>
<div class="post-container">
<div class='post-header'>
<h1 class='post-title'><?php the_title(); ?></h1>
<?php get_template_part( 'content/post-byline-micropost' ); ?>
</div>
<div class="post-content">
<?php the_content(); ?>
<?php wp_link_pages( array(
'before' => '<p class="singular-pagination">' . __( 'Pages:', 'period' ),
'after' => '</p>',
) ); ?>
<?php do_action( 'post_after' ); ?>
</div>
<div class="post-meta">
<?php get_template_part( 'content/post-categories' ); ?>
<?php get_template_part( 'content/post-tags' ); ?>
<?php get_template_part( 'content/post-nav' ); ?>
</div>
</div>
</article>
<div class="comments-container">
<?php comments_template(); ?>
</div>
</div>
<?php
the_posts_pagination( array(
'prev_text' => __( 'Previous', 'period' ),
'next_text' => __( 'Next', 'period' )
) );
get_footer();
Any ideas?
Thanks!