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 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
add comment

2 Answers

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:

http://codex.wordpress.org/Site_Design_and_Layout

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:

http://codex.wordpress.org/Template_Tags

good luck :)

share|improve this answer
add comment

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
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.