0

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:

<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 ??

2
  • This is basic php, if in_category( $category, $_post ) { should be if ( in_category( $category, $_post ) ){ Commented Jul 28, 2015 at 18:56
  • Your edit (which I have rolled back now) should be a new question. I have already posted a solution in comments ( shame on me ;-)) to the issue on WSOD. We only allow one question per post. This is not a discussion forum where you just continue a conversation or ask multiple question. Please see help center and learn how the SE sites operates. Thank you :-) Commented Jul 28, 2015 at 19:47

1 Answer 1

0

lunacodes Please change Permalink in wordpress > Settings > Permalink Settings > SELECTED Post name.

enter image description here

1
  • I've already done that/the website was already set to that
    – lunacodes
    Commented Jul 28, 2015 at 19:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.