Forums

Older entries link is not working (3 posts)

  1. gagan_3057
    Member
    Posted 1 year ago #

    Hi,
    I know its a very small problem but is bugging me for quite a long. I am using cellar heat wordpress theme. First of all this theme doesn't come with an 'Older Entries' link at the home page. Anyways, I have managed to put that and when I click on it, the URL also gets changed but older posts don't show up.
    The code for the home page is

    <?php if (have_posts()) : ?>
     <?php query_posts("showposts=1"); ?>
      <?php while (have_posts()) : the_post(); ?>
      		<div class="main-post" id="post-<?php the_ID(); ?>">
        	<h2><a>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
            <span class="meta"><?php the_time('F') ?> <?php the_time('jS') ?> <?php the_time('Y') ?> in <?php the_category(', ') ?></span>
            <?php the_excerpt('Read the rest of this entry »'); ?>
            <span class="btn-first-readon"><a>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">Read On</a></span>
            <span class="comments"><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></span>
            <br clear="all" />
            </div>
            <?php endwhile; ?>
        </div>
        <div id="recent-posts">
    
        <!-- post begin -->
    <?php query_posts("showposts=8&offset=1"); ?>
      <?php while (have_posts()) : the_post(); ?>
        	<div class="home-post" id="post-<?php the_ID(); ?>">
            	<div class="upper">
                <div class="fade"></div>
                <h3><a>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
                <span class="meta"><?php the_time('F') ?> <?php the_time('jS') ?> <?php the_time('Y') ?></span>
                <?php the_excerpt('Read the rest of this entry »'); ?>
                </div>
                <span class="btn-readon"><a>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">Read On</a></span>
                <span class="lower-meta"><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></span>
            </div>
    
    <?php endwhile; ?>
    
    <br clear="all" />
    
    <?php else: ?>
    
     <!-- Error message when no post published -->
    <?php endif; ?>
    
    <div id="page-nav"><span class="older"><?php next_posts_link('Older Entries') ?></span><span class="newer"><?php previous_posts_link('Newer Entries') ?></span></div>
        <!-- post end -->

    The <div> tag just before the last line brings the 'Older Entries' link. If you need code of any other page, I can post but kindly make me understand in detail. I shall be extremely thankful.

  2. alchymyth
    The Sweeper
    Posted 1 year ago #

    the 'offset' parameter does not work with pagination;

    to exclude the first post, try the methods described in:
    http://codex.wordpress.org/The_Loop#Multiple_Loops_in_Action

  3. gagan_3057
    Member
    Posted 1 year ago #

    Hey Dear,
    Thanks for the quick response but I guess the link is about featured post. Check out my website http://totalbarmy.org
    So as you can see, there is no concept of featured post here.

    Ok I shamelessly admit this. I am not good at understanding this PHP code, so please give me a direct solution. Just tell me what all you need, I'll paste that code. But please if you directly tell me the coding lines and where to paste them.

    Thanks :)

Topic Closed

This topic has been closed to new replies.

About this Topic