Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // set the "paged" parameter (use 'page' if the query is on a static front page)
- $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
- // the query
- $blog = new WP_Query( 'cat=1&paged=' . $paged );
- ?>
- <?php if ( $blog->have_posts() ) : ?>
- <ul id=\"internal-landing\">
- <?php
- // the loop
- while ( $blog->have_posts() ) : $blog->the_post();
- ?>
- <li class="blog-landing">
- <h2><?php the_title(); ?></h2>
- <p><?php the_content(); ?</p>
- </li>
- <?php endwhile; ?>
- </ul>
- <?php
- // get_next_posts_link() usage with max_num_pages
- echo get_next_posts_link( 'Older Entries', $blog->max_num_pages );
- echo get_previous_posts_link( 'Newer Entries' );
- ?>
- <?php
- // clean up after our query
- wp_reset_postdata();
- ?>
- <?php else: ?>
- <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement