Display Single Post On Homepage
-
I recently upgraded to 2.6. Before the upgraded I had a single post on the home page. After the upgrade all my posts appear on the homepage and that doesn’t change even if I change the settings on the backend to show a single post.
Here is index.php:
<?php get_header(); ?> <!-- begin post --> <?php if (! empty($display_stats) ) { get_stats(1); echo "<br />"; } else if (($posts & empty($display_stats)) ) : foreach ($posts as $post) : start_wp(); ?> <div class="entry"> <?php global $post, $tableposts; $previous = @$wpdb->get_var("SELECT ID FROM $tableposts WHERE post_date < '$post->post_date' AND post_status = 'publish' ORDER BY post_date DESC LIMIT 1, 1"); if ($previous) { $link = get_permalink($previous); echo '<a href="' . $link . '" title="Previous">' . $post->post_content . '</a> '; } else { the_content('[More photos]'); } ?> </div> <div class="posted"> Click Image For Previous | <a href="<?php the_permalink() ?>" title="Permalink"><?php the_time('M j, \'y') ?></a> | <?php the_category(', '); ?> <?php previous_posts_link('| Next »') ?> | <?php next_post('%', ' Next', 'no'); ?> </div> <br /> <br /> <!-- <?php trackback_rdf(); ?> --> <?php endforeach; else: ?> <center> <img id="image237" src="https://www.bingwalker.com/wp/wp-content/uploads/sen_in_bookstore.jpg" alt="sen_in_bookstore.jpg" /> </center> <?php endif; ?> <!-- end post --> <?php include("menu.php"); ?> </div> <?php get_footer(); ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Display Single Post On Homepage’ is closed to new replies.