In which area you want to display your post?

Where you want to display your post?

First you create your category.
Go to wp-admin panel -> create new category.

Use the below code where you want to display your post.


<?php if ( have_posts() ) : ?>

<?php query_posts('category_name=Your category name&showposts=1'); while ( have_posts() ) :

the_post(); ?>

<?php the_content(); ?>

<?php endwhile; ?>

<?php endif; // end have_posts() check ?>

Here I create principalmessage category like below.


<?php if ( have_posts() ) : ?>

<?php query_posts('category_name=principalsmessage&showposts=1'); while ( have_posts() ) :

the_post(); ?>

<?php the_content(); ?>

<?php endwhile; ?>

<?php endif; // end have_posts() check ?>

About the Author

avatar