SHOW:
|
|
- or go back to the newest paste.
| 1 | <?php | |
| 2 | /** | |
| 3 | * Template Name: Page of Posts | |
| 4 | * | |
| 5 | * for a child theme of Twenty_Twelve | |
| 6 | * with output of the page content | |
| 7 | */ | |
| 8 | ||
| 9 | get_header(); ?> | |
| 10 | ||
| 11 | <div id="primary" class="site-content"> | |
| 12 | <div id="content" role="main"> | |
| 13 | ||
| 14 | <?php while ( have_posts() ) : the_post(); // show the actual page's content and comments ?> | |
| 15 | <?php get_template_part( 'content', 'page' ); ?> | |
| 16 | <?php comments_template( '', true ); ?> | |
| 17 | <?php endwhile; // end of the loop. ?> | |
| 18 | ||
| 19 | <?php | |
| 20 | $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
| |
| 21 | $args= array( | |
| 22 | 'category_name' => 'antiquarianism', // Change this category SLUG to suit your use; or see for query parameters http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
| 23 | 'paged' => $paged | |
| 24 | ); | |
| 25 | query_posts($args); | |
| 26 | if( have_posts() ) :?> | |
| 27 | ||
| 28 | <?php while ( have_posts() ) : the_post(); ?> | |
| 29 | <?php get_template_part( 'content', get_post_format() ); ?> | |
| 30 | <?php comments_template( '', true ); ?> | |
| 31 | <?php endwhile; // end of the loop. ?> | |
| 32 | ||
| 33 | <?php twentytwelve_content_nav( 'nav-below' ); ?> | |
| 34 | ||
| 35 | <?php else : ?> | |
| 36 | <article id="post-0" class="post no-results not-found"> | |
| 37 | <header class="entry-header"> | |
| 38 | <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentytwelve' ); ?></h1> | |
| 39 | </header> | |
| 40 | <div class="entry-content"> | |
| 41 | <p><?php _e( 'Apologies, but no results were found. Perhaps searching will help find a related post.', 'twentytwelve' ); ?></p> | |
| 42 | <?php get_search_form(); ?> | |
| 43 | </div><!-- .entry-content --> | |
| 44 | </article><!-- #post-0 --> | |
| 45 | ||
| 46 | <?php endif; wp_reset_query(); ?> | |
| 47 | ||
| 48 | </div><!-- #content --> | |
| 49 | </div><!-- #primary --> | |
| 50 | ||
| 51 | <?php get_sidebar(); ?> | |
| 52 | <?php get_footer(); ?> |