Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Template Name: Page of Posts
- */
- /* if you are not using this in a child of Twenty Eleven,
- * you need to replicate the html structure of your own theme.
- */
- get_header(); ?>
- <div id="primary" class="site-content">
- <div id="content" role="main">
- <?php
- /* the_post will retrieve the content of the new page you
- * create to list the posts, e.g. as an intro to describe
- * which posts are shown.
- */
- the_post();
- // Display content of page
- get_template_part( 'content', get_post_format() );
- wp_reset_postdata();
- $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
- $args = array(
- // Change these category SLUGS to suit your use.
- 'category_name' => 'news',
- 'paged' => $paged
- );
- $list_of_posts = new WP_Query( $args );
- twentytwelve_content_nav( 'nav-above' );
- while ( $list_of_posts->have_posts() ): $list_of_posts->the_post();
- // Display content of posts
- get_template_part( 'content', get_post_format() );
- endwhile;
- twentytwelve_content_nav( 'nav-below' );
- ?>
- </div><!-- /#content -->
- </div><!-- /#primary -->
- <?php get_footer();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement