WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I making my first Wordpress template. I used this code to add only the h1 to the page.

<?php $title = get_the_title($post->ID); echo $title; ?>

But is there a code. That only add the post to the page?

share|improve this question
up vote 1 down vote accepted

Use this code to show the content of a post or a page:

<?php the_content() ?>

Use this code to show the title of a post or a page:

<?php the_title() ?>

This page can be useful if you are new to designing WP themes:


Here is a list of the template-tags you can use in your template to show info like date, nvaigation, comment-field, comment-form, title, excerpt, content etc:


good luck :)

share|improve this answer

When you say 'only add the post to the page' I'm assuming you are looking for <?php the_content(); ?>

I suggest that you read the Wordpress documentation on developing your own templates - HERE and more specifically - HERE

share|improve this answer

Your Answer


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.