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

What is the code in order to put some posts in different pages? I already have one but the tittle of post is missing. And i don't know how to.

This is the code that i have now:

<?php get_header(); ?>

<div id="innerTop">
        <div class="innerTitle clearfix"><h1><?php the_title(); ?></h1></div>
        <?php $pagedesc = get_post_meta($post->ID, 'page_description', $single = true);?>
        <?php if($pagedesc !=''){?>
        <div class="innerDesc"><?php echo $pagedesc ?></div>
        <?php }?>

<!-- begin colLeft -->
    <div id="colLeft">
$catID = 0;
if (is_page('apple')) {
} elseif (is_page('htc')) {
} elseif (is_page('nokia')) {

if ($catID) {
   $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
} ?>
$title = $queried_post->post_title;
echo $title;

        <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

        <?php the_content(__('(more...)')); ?>

        <?php endwhile; else: ?>
        <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
        <?php endif; ?>
    <!-- end colleft -->

    <?php get_sidebar(); ?>  

<?php get_footer(); ?>

I would love for an answer please.

share|improve this question

get_posts may be easier for you to use:

        $args = array( 'numberposts' => 5, 'category' => '3' );
        $myposts = get_posts( $args );
        foreach( $myposts as $post ) :  setup_postdata($post); ?>
            <div <?php post_class(); ?> id="post-<?php the_ID(); ?>" style="padding-bottom:5px;">
                <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
                <div class="post_meta"><?php twentyten_posted_on(); ?></div>
                    <div class="entryContent">
                        <?php the_content(); ?>             

        <?php endforeach; ?>
share|improve this answer
I'm really new at this. There is anything i have to change on your code? Sorry – catarina moura Jul 13 '11 at 21:28
To not restrict by category, remove the ",'category' => '3'' – GavinR Jul 14 '11 at 1:17

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.