SHOW:
|
|
- or go back to the newest paste.
| 1 | <?php | |
| 2 | - | $the_query = new WP_Query( 'posts_per_page=1'); |
| 2 | + | |
| 3 | - | if(have_posts()) : while($the_query->have_posts()) : $the_query->the_post(); ?> |
| 3 | + | add_action( 'pre_get_posts', 'raits_change_posts_per_page' ); |
| 4 | - | <h2><a href="<?php the_permalink(); ?>" |
| 4 | + | |
| 5 | - | title="<?php the_title(); ?>"><?php the_title(); ?></a></h2> |
| 5 | + | function raits_change_posts_per_page( $query ) {
|
| 6 | - | <small>Posted by <?php the_author(); ?>, <?php the_time('M d'); ?></small>
|
| 6 | + | // Change is_home() to whatever you want |
| 7 | - | <?php the_content('Read More'); ?>
|
| 7 | + | // Just make it select just the stuff you want to affect |
| 8 | - | <div class="separator biggap"></div> |
| 8 | + | if ( $query->is_main_query() && $query->is_home() ) |
| 9 | - | <?php endwhile ?> |
| 9 | + | $query->set( 'posts_per_page', 1 ); |
| 10 | - | <div id="posts_navigation"> |
| 10 | + | } |