posts_per_page makes post header disappear
-
Hello,
I am trying to modify the number of posts per page on my monthly archive page (trying to make it 30). I am able to do this with:
query_posts('posts_per_page=30');
I have tried this inside of the get_header call:
<?php get_header(); query_posts('posts_per_page=30'); ?> <?php if (have_posts()) : ?>
as well as outside:
<?php get_header(); ?> <?php query_posts('posts_per_page=30'); ?> <?php if (have_posts()) : ?>
Either way, it makes the page header disappear. It should say ‘Archive for March, 2010’, but instead it goes right to listing the archive entries. Here is the code for the full page:
<?php get_header(); ?> <?php query_posts('posts_per_page=30'); ?> <?php if (have_posts()) : ?> <div class="post-box page-box"> <div class="post-header"> <?php /* If this is a category archive */ if (is_category()) { ?> <h1 class="pagetitle"><?php printf(__ ('Posts from the ‘%s’ Category', 'punchcut'), single_cat_title("", false))?></h1> <?php /* If this is a tag archive */ } elseif( is_tag() ) { ?> <h1 class="pagetitle"><?php printf(__ ('Posts tagged ‘%s’', 'punchcut'), single_tag_title("", false))?></h1> <?php /* If this is a daily archive */ } elseif (is_day()) { ?> <h1 class="pagetitle"><?php _e('Archive for', 'punchcut') ?> <?php the_time(__ ('F jS, Y', 'punchcut')) ?></h1> <?php /* If this is a monthly archive */ } elseif (is_month()) { ?> <h1 class="pagetitle"><?php _e('Archive for', 'punchcut') ?> <?php the_time(__ ('F, Y', 'punchcut')) ?></h1> <?php /* If this is a yearly archive */ } elseif (is_year()) { ?> <h1 class="pagetitle"><?php _e('Archive for', 'punchcut') ?> <?php the_time(__ ('Y', 'punchcut')) ?></h1> <?php /* If this is an author archive */ } elseif (is_author()) { if (isset($_GET['author_name'])) $current_author = get_userdatabylogin($author_name); else $current_author = get_userdata(intval($author));?> <h1 class="pagetitle"><?php printf(__ ('Posts by %s', 'punchcut'), $current_author->nickname)?></h1> <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?> <h1 class="pagetitle"><?php _e('Blog Archives', 'punchcut') ?></h1> <?php } ?> </div><!--end post-header--> <div class="entries"> <img class="archive-comment" src="<?php bloginfo('template_url'); ?>/images/comments-bubble.png" width="17" height="14" alt="<?php _e('comment', 'punchcut') ?>"/> <ul> <?php while (have_posts()) : the_post(); ?> <li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><span class="comments_number"><?php comments_number('0', '1', '%', ''); ?></span><span class="archdate"><?php the_time(__ ('n.j.y', 'punchcut')) ?></span><?php the_title(); ?></a></li> <?php endwhile; /* rewind or continue if all posts have been fetched */ ?> </ul> </div><!--end entries--> </div><!--end post-box--> <div class="pagination clear"> <div class="alignleft"><?php next_posts_link(__ ('← Previous', 'punchcut')) ?></div> <div class="alignright"><?php previous_posts_link(__ ('Next →', 'punchcut')) ?></div> </div><!--end pagination--> <?php else : ?> <?php endif; ?> </div><!--end content--> <?php get_sidebar(); ?> <?php get_footer(); ?>
Here is a link to the page:
https://lifeafterfashion.com/?m=201003Thanks for any help!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘posts_per_page makes post header disappear’ is closed to new replies.