1

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?

  • 2
    Please add debug information to your question to make answers possible. – fuxia 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
1

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(); ?>
| 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.