Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I created a Page Template following these instructions: http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

When I create some text in a test page and apply the template I created using the instructions at that link, the text I create doesn't show up when I go 'view page'.

What code do I need to add to the template so that text shows up?

share|improve this question
2  
Please add debug information to your question to make answers possible. –  toscho Jul 29 '12 at 20:55
    
what is the exact code of your page template? –  Michael Jul 29 '12 at 21:33
    
If you view source, can you see the text in the HTML? it may be a styling issue –  101phil Jul 29 '12 at 22:18
add comment

1 Answer

up vote 1 down vote accepted

Your template must have the the_content() function called within the Wordpress loop to show up the text you've entered while creating new post.

You might have missed the the_content() function in your custom template, that function retrieves and show the content of your page.

Here is sample usage

<?php get_header(); ?>
    <div>
        <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
            <?php the_title(); ?>
            <?php the_content(); /*This code prints the content*/ ?> 
        <?php endwhile; endif; ?>
    </div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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