WordPress.org

Ready to get started?Download WordPress

Forums

Bittersweet Theme Not Indexing Previous Posts (2 posts)

  1. KaoSouL
    Member
    Posted 7 years ago #

    Hi I need help with my set http://www.myteenutopia.com
    WARNING ADULT CONTENT 18+

    I'm using the Bittersweet theme by Headsetoption (link)

    I'm trying to setup the index page of my site with a "previous posts" link at the bottom. I've searched and followed the tutorials and I'm using this code.

    <div class="navigation">
    <div class="right"><?php previous_posts_link('&laquo; NEXT ENTRIES') ?></div>
    <div class="left"><?php next_posts_link('PREVIOUS ENTRIES &raquo;') ?></div>
    </div>

    It seems to be working in theory, as it generates the link http://www.myteenutopia.com/page/2/ the problem is when this page loads it's just the same as my index page. It's not pulling the older posts. If I switch to any other theme the /page/2/ link will work correctly and pull the older links

    So I need a little help, does anyone have a clue why the Bittersweet theme is not working for me?

  2. KaoSouL
    Member
    Posted 7 years ago #

    I believe there is a problem with the index.php itself, but I hardly know anything about coding, so I'm including my whole index.php file for someone smarter then me to look over.

    <?php
    get_header();
    ?>
    
    <div class="main">
    <div class="item">
    
    <div class="date">
    <div><?php the_time('M');?></div>
    <span><?php the_time('d');?></span> </div>
    <div class="content">
    
    <!-------first layer---------->
    
    <?php
    // Here is the call to only make two posts show up on the homepage REGARDLESS of your options in the control panel
    query_posts('showposts=1');
    ?>
    <?php if (have_posts()) : ?>
    <?php $first = true; ?>
    <?php while (have_posts()) : the_post(); ?>
    <div class="story<?php if($first == true) echo " first" ?>">
    
    <h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a>
    </h1>
    <div class="details">
    <small>
    Posted on <?php the_time('M d Y');?> <br/>
    Filed under <?php the_category(', ') ?> <br/></small></div>
    <div class="body"> <p><?php the_content('<p class="serif">Read the rest of this entry &raquo;</p>'); ?><br><?php related_posts(); ?><br><br>   </div>
    </p>
    </div>
    <?php if($first==true) { $first= false;} else {echo '<div class="clear"></div>';$first= true; } ?>
    <?php endwhile; ?>
    <?php else : ?>
    <h2 class="center">Not Found</h2>
    <p class="center">Sorry, but you are looking for something that isn't here.</p>
    <?php include (TEMPLATEPATH . "/searchform.php"); ?>
    <?php endif; ?>
    <div class="clear"></div>
    
    <!-------end first layer---------->
    
    <!-------second layer---------->
    
    <?php
    $posts = get_posts('numberposts=5&offset=1');
    	foreach($posts as $post) :
    	setup_postdata($post);
    ?>
    <h1>
    <a href="<?php the_permalink() ?>" title="Continue reading <?php the_title(); ?>" rel="bookmark"><?php the_title(); ?></a>
    </h1>
    <div class="details">
    <small>
    Posted on <?php the_time('M d Y');?> <br/>
    Filed under <?php the_category(', ') ?> <br/></small></div>
    <div class="body"> <p><?php the_content('<p class="serif">Read the rest of this entry &raquo;</p>'); ?><br><?php related_posts(); ?><br><br>   </div>
    </p>   
    
    <?php endforeach; ?>
    
    		<div class="navigation">
    			<div class="right"><?php previous_posts_link('&laquo; NEXT ENTRIES') ?></div>
    			<div class="left"><?php next_posts_link('PREVIOUS ENTRIES &raquo;') ?></div>
    		</div><br><br>
    <br><br>
    
    <!-------end second layer---------->
    
    </div>
    </div>
    
    </div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic