Custom theme – Only 1 post showing on the blog page
-
I built a custom theme and would like to have a static page on the home page and an internal page for my blog posts.
Here is the loop on my main index.php
<?php get_header(); ?> <div id="contentWrap" class="group"> <?php get_sidebar(); ?> <div id="article"> <?php if (have_posts()) :while (have_posts()) : the_post();?> <?php endwhile; ?> <?php endif;?> <h2><?php the_title(); ?></h2> <div id="entryItem"> <?php the_content(); ?> </div><!--entryItem--> </div><!--article--> </div><!--contentWrap--> </div><!--mainWrapper--> <?php get_footer(); ?>
Here is the code for my blog template page.
<?php /* Template Name: Blog */ ?> <?php get_header(); ?> <div id="contentWrap" class="group"> <?php get_sidebar(); ?> <div id="article"> <?php $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query(); $wp_query->query('showposts=ALL'.'&paged='.$paged); while ($wp_query->have_posts()) : $wp_query->the_post(); ?> <?php endwhile; ?> <?php $wp_query = null; $wp_query = $temp;?> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <p> Posted By <?php the_author(); ?></p> <div id="entryItem"> <?php the_content(); ?> </div><!--entryItem--> </div><!--article--> </div><!--contentWrap--> </div><!--mainWrapper--> <?php get_footer(); ?>
It seems to be working, but it will only show one post.
Help please!!
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘Custom theme – Only 1 post showing on the blog page’ is closed to new replies.