0

I have registered a template like this, but on the template, I was wondering how to get all of the current themes functionality to exist on the template, as some parts are missing in the way I have this template set up.

the template file is currently blank, I included wp_head() and get_header() in the template file, it works somewhat, but most of the theme is missing, such as the pages content.

any ideas?

<?php
add_filter( 'template_include', 'template_management' );

if ( ! function_exists( 'template_management' ) ) {

function template_management( $template )
{

    return plugin_dir_path( __FILE__ ) . 'templates/the-template.php';



    return $template;
}
}
?>
0

I would suggest you copy page.php into your custom template, and then modify the code as required. At the very least, your template should look something like:

<?php get_header() ?>

<?php while ( have_posts() ) : the_post() ?>

    <article <?php post_class() ?>>
        <?php the_title( '<h1 class="entry-title">', '</h1>' ) ?>

        <div class="entry-content">
            <?php the_content() ?>
        </div>
    </article>


<?php endwhile ?>

<?php get_footer() ?>
3
  • oh yeagh I didn't even think to do that, works now.
    – charles
    Jan 17 '15 at 12:11
  • Or you can just make a copy of index.php an rename it :-) Jan 17 '15 at 12:11
  • @charles then please tick the "solution" check mark below the voting arrow on the left.
    – kaiser
    Jan 17 '15 at 12:45

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.