WordPress.org

Ready to get started?Download WordPress

Forums

template to view posts (3 posts)

  1. dunderhonung
    Member
    Posted 1 year ago #

    Hi!

    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
    Forum Moderator
    Posted 1 year 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
    Member
    Posted 1 year 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