• I am using the F8 theme. Basically I have three blog excerpts shown on my home page. I want to set up another page to display older posts in the same format. As I didn’t write the code for the homepage, I’m having trouble deciphering it. I can get a loop to show up under my “blog” page but I can’t seem to get it into the same format (three columns and a thumbnail) Here’s the code from the index page

    <?php get_header(); ?>
    
    <?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  } ?>">
    <h6 class="archive-header"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title() ?></a></h6>
    <?php
    	$values = get_post_custom_values("thumbnail");
    	if (isset($values[0])) {
    ?>
    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><img src="<?php $values = get_post_custom_values("thumbnail"); echo $values[0]; ?>" alt="" /></a>
    <?php } ?>
    <?php the_excerpt(); ?>
    <p class="postmetadata"><?php the_time('M d, Y') ?> | <?php comments_popup_link('Have your say »', '1 Comment »', '% Comments »'); ?></p>
    </div>
    <?php if ($i == 3) { ?><div class="archive-stack clear"></div><?php $i = 0; } ?>
    <?php endwhile; ?>
    
    <div class="clear"></div>
    
    <div class="navigation">
    	<div><?php next_posts_link('&laquo; Older Entries') ?></div>
    	<div><?php previous_posts_link('Newer Entries &raquo;') ?></div>
    </div>
    
    <?php else : ?>
    
    <h2>Not Found</h2>
    <p>Sorry, but you are looking for something that isn't here.</p>
    <?php include (TEMPLATEPATH . "/searchform.php"); ?>
    
    <?php endif; ?>
    <?php include (TEMPLATEPATH . "/bottom.php"); ?>
    <?php get_footer(); ?>

    And the code I’m using in the blog page

    <?php
    /*
    Template Name: Blog
     */
    
    get_header(); ?>
    		<?php $posts = get_posts( "numberposts=12" ); ?>
    <?php if( $posts ) : ?>
         <?php foreach( $posts as $post ) : setup_postdata( $post ); ?>
           <div class="post">
              <p class="post-info-home"><h6><?php the_title(); ?></p></h6>
              <div class="post-title-home">
                <?php the_time('d M Y h:i a'); ?>
           </div>
           <div class="entry">
              <?php the_excerpt(); ?>
              <em><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>">READ ENTIRE POST</a></em>
           </div>
         </div>
       <?php endforeach; ?>
    <?php endif; ?>
    <?php include (TEMPLATEPATH . "/bottom.php"); ?>
    <?php get_footer(); ?>

    Any help would be much appreciated. Thanks.

  • The topic ‘Setting up a secondary blog page’ is closed to new replies.