Custom Single Post Type not referring to single-post-type.php File
-
I’ve defined a Custom Post type called “Press”, I’m trying to modify the Single Posts template for that Custom Type. The single posts custom file is called “single-press.php”
I’ve tried using an if in_category(cat_number), get_template_part type statement in single.php & it seems to give me a White Screen rather than the page …
This is the code I’m currently attempting in my single.php file:
<?php get_header(); ?> <div class="row"> <div class="col-sm-12"> <?php get_sidebar(); ?> </div> </div> <?php if in_category( $category, $_post ) { echo('Category') } ?> <div class="row"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="col-sm-8 col-sm-offset-2"> <article <?php post_class() ?> id="post-<?php the_ID(); ?>"> <?php if(has_post_thumbnail()){ the_post_thumbnail('large'); }; ?> <h1 class="single-entry-title"><?php the_title(); ?></h1> <h2 class="subhead"><?php the_field('subhead'); ?></h2> <?php include (TEMPLATEPATH . '/meta.php' ); ?> <div class="entry-content"> <?php the_content(); ?> </div> </article> <?php endwhile; endif; ?> </div> </div> <div class="row"> <div class="col-sm-12"> <?php related_posts() ?> </div> </div> <?php get_footer(); ?>
Does anyone have some suggestions as to what might be going wrong, or how to get the Single “Press” posts to follow what’s in single-press.php ??
- The topic ‘Custom Single Post Type not referring to single-post-type.php File’ is closed to new replies.