Posts_per_page and the date.php
-
I have the following code in my date.php file, and wanted to return 30 posts per page (instead of the amount set in WP Settings).
<?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <article class="post-container"> <h5 class="post-title"> <a href="<?php echo get_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a> </h5> <p class="post-meta">Posted on <?php the_time('F jS, Y') ?> in <?php the_category(', ') ?></p> </article> <?php endwhile; ?> <?php else : ?> <article class="post-container"> <h4 class="post-title">No Content Found</h4> <p>We're sorry, but there are no posts or articles currently available. Please return soon.</p> <p> <a href="<?php echo get_option('home'); ?>">Return to the homepage</a> </p> </article> <?php endif; wp_reset_query(); ?>
I tried to modify the code by adding the following at the top of the loop, but while it returns 30 posts per page, it no longer returns for each year selected:
<?php query_posts('posts_per_page=30'); if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?>
How can I get this to work?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Posts_per_page and the date.php’ is closed to new replies.