I've been following this tutorial: http://www.wpbeginner.com/wp-themes/create-custom-single-post-templates-for-specific-posts-or-sections-in-wordpress/

To create a custom template for "post"-type webpages. The tutorial calls for copying the contents of single.php into a blank sheet in which I define a template name (in this case it's "Series").

I have successfully made it appear as a selectable option in the "Post Attributes" section of the "Edit Post" screen, but when I select it and preview the post I'm met with a 500 internal server error.

At first I thought it was due to some type of php syntax, but after cleaning up opening and closing tags I don't see wh

I am using the HTML5 blank theme. Code below:

 * Template Name: Series
 * Template Post Type: post, page, product


    <div id="primary" class="content-area">
        <main id="main" class="site-main" role="main">

        // Start the loop.
        while ( have_posts() ) : the_post();

             * Include the post format-specific template for the content. If you want to
             * use this in a child theme, then include a file called content-___.php
             * (where ___ is the post format) and that will be used instead.
            get_template_part( 'content', get_post_format() );

            // If comments are open or we have at least one comment, load up the comment template.
            if ( comments_open() || get_comments_number() ) :

            // Previous/next post navigation.
            the_post_navigation( array(
                'next_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Next', 'twentyfifteen' ) . '</span> ' .
                    '<span class="screen-reader-text">' . __( 'Next post:', 'twentyfifteen' ) . '</span> ' .
                    '<span class="post-title">%title</span>',
                'prev_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Previous', 'twentyfifteen' ) . '</span> ' .
                    '<span class="screen-reader-text">' . __( 'Previous post:', 'twentyfifteen' ) . '</span> ' .
                    '<span class="post-title">%title</span>'
            ) );

        // End the loop.

        </main><!-- .site-main -->
    </div><!-- .content-area -->

<?php get_footer(); ?>

The first step in this situations is to enable WP_DEBUG to get more info about the error, you can learn more here https://codex.wordpress.org/WP_DEBUG

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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