Forums

Have a custom theme and on home.php previous and next posts buttons don't appear (1 post)

  1. arcd
    Member
    Posted 3 years ago #

    I know this has been asked a few times but I've looked around and around and none of the fixes posted seem to sort my issue.

    all the code in the index.php seems fine - however my site uses a file called home.php which displays just the snippets of the posts not the whole posts.

    The previous (older) posts and next (newer) posts links don't show. I changed code on one occasion and got them to show, but when clicking on them they just went to page2 but with the same content displayed??

    ---
    This is the code from the index.php file

    <?php get_header() ?>

    <div id="container">
    <div id="content">

    <div id="nav-above" class="navigation">
    <div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">«</span> Older posts', 'sandbox')) ?></div>
    <div class="nav-next"><?php previous_posts_link(__('Newer posts <span class="meta-nav">»</span>', 'sandbox')) ?></div>
    </div>

    <?php while (have_posts()) : the_post();
    if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?>

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

    <h2 class="entry-title">" title="<?php printf(__('Permalink to %s', 'sandbox'), wp_specialchars(get_the_title(), 1)) ?>" rel="bookmark"><?php the_title() ?></h2>
    <div class="entry-date"><abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO'); ?>"><?php unset($previousday); printf(__('%1$s – %2$s', 'sandbox'), the_date('', '', '', false), get_the_time()) ?></abbr></div>
    <div class="entry-content">
    <?php the_content(''.__('Read More <span class="meta-nav">»</span>', 'sandbox').''); ?>

    <?php wp_link_pages('before=<div class="page-link">' .__('Pages:', 'sandbox') . '&after=</div>') ?>
    </div>
    <div class="entry-meta">
    <span class="author vcard"><?php printf(__('By %s', 'sandbox'), 'ID, $authordata->user_nicename).'" title="' . sprintf(__('View all posts by %s', 'sandbox'), $authordata->display_name) . '">'.get_the_author().'') ?></span>
    <span class="meta-sep">|</span>
    <span class="cat-links"><?php printf(__('Posted in %s', 'sandbox'), get_the_category_list(', ')) ?></span>
    <span class="meta-sep">|</span>
    <?php the_tags(__('<span class="tag-links">Tagged ', 'sandbox'), ", ", "</span>\n\t\t\t\t\t<span class=\"meta-sep\">|</span>\n") ?>
    <?php edit_post_link(__('Edit', 'sandbox'), "\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t<span class=\"meta-sep\">|</span>\n"); ?>
    <span class="comments-link"><?php comments_popup_link(__('Comments (0)', 'sandbox'), __('Comments (1)', 'sandbox'), __('Comments (%)', 'sandbox')) ?></span>
    </div>
    </div><!-- .post -->

    <?php comments_template() ?>
    <?php endwhile ?>

    <div id="nav-below" class="navigation">
    <div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">«</span> Older posts', 'sandbox')) ?></div>
    <div class="nav-next"><?php previous_posts_link(__('Newer posts <span class="meta-nav">»</span>', 'sandbox')) ?></div>
    </div>

    </div><!-- #content -->
    </div><!-- #container -->

    <?php get_sidebar() ?>
    <?php get_footer() ?>

    ---

    This is code on the home.php file
    --
    <?php get_header() ?>

    <div id="content">

    <div id="nav-above" class="navigation">
    <div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">«</span> Older posts', 'sandbox')) ?></div>
    <div class="nav-next"><?php previous_posts_link(__('Newer posts <span class="meta-nav">»</span>', 'sandbox')) ?></div>
    </div>

    <h3>Fresh</h3>
    <?php query_posts('showposts=10'); ?>

    <?php while (have_posts()) : the_post();
    if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?>

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

    <span class="cat-links"><?php printf(__('%s', 'sandbox'), get_the_category_list(', ')) ?></span>
    <h2 class="entry-title">" title="<?php printf(__('Permalink to %s', 'sandbox'), wp_specialchars(get_the_title(), 1)) ?>" rel="bookmark"><?php the_title() ?></h2>
    <div class="entry-content">

    <?php the_excerpt(); ?>

    </div>

    <div class="entry-meta">
    <span class="entry-date"><abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO'); ?>"><?php unset($previousday); printf(__('%1$s', 'sandbox'), the_date('', '', '', false), get_the_time()) ?></abbr></span>
    <span class="meta-sep">|</span>

    <span class="author vcard"><?php printf(__('%s', 'sandbox'), 'ID, $authordata->user_nicename).'" title="' . sprintf(__('View all posts by %s', 'sandbox'), $authordata->display_name) . '">'.get_the_author().'') ?></span>
    <span class="meta-sep">|</span>

    <span class="comments-link"><?php comments_popup_link(__('add a comment', 'sandbox'), __('1 comment', 'sandbox'), __('% Comments', 'sandbox')) ?></span>
    </div>
    </div><!-- .post -->
    <?php endwhile ?>

    <div id="nav-below" class="navigation">
    <div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">«</span> Older posts', 'sandbox')) ?></div>
    <div class="nav-next"><?php previous_posts_link(__('Newer posts <span class="meta-nav">»</span>', 'sandbox')) ?></div>
    </div>

    </div><!-- #content -->

    <div class="middle">

    <?php if (function_exists('get_recent_comments')) { ?>
    <h3>Comments</h3>

      <?php get_recent_comments($limit = 5); ?>

    <?php } ?>

    </div><!-- #middle -->
    </div><!-- #container -->

    <?php get_sidebar() ?>
    <?php get_footer() ?>

    Any help gratefully received. My Url is blog.ffburo.com - and the theme is a tweak of Futurosity Eos...

Topic Closed

This topic has been closed to new replies.

About this Topic