WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Template
Custom post template guts all other formatting (3 posts)

  1. Lnelson
    Member
    Posted 2 years ago #

    Hi there,

    Not incredibly experienced- learning through a lot of trial and error- hoping to get an answer on this.

    I initially used custom post templates in the jas-personal-publisher theme, and it worked fine. I'm doing a redesign for our company's blog using the Brunelleschi theme, and we need multiple custom post templates for compliance reasons.

    I followed the same protocol as before when developing the custom templates- pasting in the following code at the top:

    <?php
    /*
    Template Name Posts: Type 1
    */
    ?>

    The code after that is the same as the post code found in loop-single.php. Using the same method as before, I attempted to paste in code for a paragraph to follow the post after the entry content, similar to below:

    <div class="entry-content">
       <?php the_content(); ?>
       <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'brunelleschi' ), 'after' => '</div>' ) ); ?>
       <p>This is a disclaimer</p>
    </div><!-- .entry-content -->

    I then put up a post, selecting the custom template before publishing. The result? A plain-text webpage with the blog content stripped of all blog formatting. Any explanation as to why? Any suggestions on how to fix it?

    http://wordpress.org/extend/plugins/custom-post-template/

  2. Dave Doolin
    Member
    Posted 2 years ago #

    Did you figure this out?

  3. spsmw
    Member
    Posted 2 years ago #

    In case others are having this issue — Lnelson, rather than the loop-single.php you copied, the file you need to copy/replicate is single.php, which has a lot more code in it, including references to header and footer and everything else the page needs to work correctly and look like you want it to.

    The template you create replaces single.php for that post, so you need everything single.php has, just tweak it for your uses.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic