WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Home page posts then more posts (3 posts)

  1. tydende
    Member
    Posted 6 years ago #

    This seems like such an incredibly basic question, but i can't find the answer or get it to work.

    I want to post 10 posts on my home page, got that, with "next page" and "previous page" buttons below linking to the next posts in order.

    i tried
    <?php posts_nav_link(' • ', __('« Newer Entry'), __('Older Entry »')); ?>

    and a few other similar codes, but when i clcik on the "next Page", or "Older Entry" it just shows the same 10 posts as the first page.

    Any ideas?

    Thanks.

  2. tydende
    Member
    Posted 6 years ago #

    here's the code on page

    <?php
    $page = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("cat=1&showposts=10&paged=$page");
    ?>
    <?php if (have_posts()) : while (have_posts()) : the_post();
    if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?>

    <div class="post" id="post-<?php the_ID(); ?>">

    <h2>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></h2>

    <div class="entry"><p>
    <?php if(function_exists(digg_this)) { digg_this('', '', '', ''); } ?>
    <?php the_content('Read the rest'); ?>
    <img src="http://www.iamelephant.com/assets/images/comment.jpg"><?php comments_popup_link('Comment!'); ?></p>
    </div>

    <p class="postinfo">By <?php the_author_posts_link(); ?> on <?php the_time('M j, Y') ?> in <?php the_category(', ') ?> | <?php

    comments_popup_link('0 Comments', '1 Comment', '% Comments'); ?><?php edit_post_link('Edit', ' | ', ''); ?></p>
    </div>

    <?php endwhile; endif; ?>

    <div class="navigation"><p><?php posts_nav_link(); ?></p></div>

  3. mckayphotography
    Member
    Posted 5 years ago #

    I had the same issue, and used this code which worked - I dont know why (i grabbed it from another theme) but it does so I'm happy :)

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

    <?php $i = 0; ?>
    <?php while (have_posts()) : the_post(); $i++; ?>
    <div class="span-8 post-<?php the_ID(); ?><?php if ($i == 3) { ?> last<?php } ?>">'

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.