template to view posts (3 posts)

  1. dunderhonung
    Posted 3 years ago #


    I need some help to make a template so I can see all my posts at a specific page. The code I been written dosent work at all it looks like this

    <?php $ppp=2; ?>
    <?php $theOffset = $ppp * $paged; ?>

    <?php query_posts('posts_per_page=$ppp&post_type=post&offset=$theOffset'); ?>

    <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
    <?php echo '<div class="contentBox">'; ?>
    <?php echo'<h2>'; the_title(); echo'</h2>'; ?>
    <?php the_content(); ?>

    <?php echo'</div>'; ?>
    <?php endwhile; ?>
    <?php next_posts_link() ?>

    post_per_page dosent work and not the <?php next_posts_link() ?> either.

    I also want to have the comments fields and a link to previous posts.

    can someone please help?

  2. Andrew Nevins
    Forum moderator
    Posted 3 years ago #

    You could look at how the default WordPress themes manage it, such as Twenty Ten and Twenty Eleven.

    Check the Codex function reference http://codex.wordpress.org/Function_Reference .

  3. dunderhonung
    Posted 3 years ago #

    I tried to do that but couldn't solve my problem.

    Im using starkers naked theme and tried to get a clue about it by reading your link.. I also had a look at http://codex.wordpress.org/Function_Reference/query_posts

Topic Closed

This topic has been closed to new replies.

About this Topic