SHOW:
|
|
- or go back to the newest paste.
1 | <?php | |
2 | /** | |
3 | Template Name: Custom Posts | |
4 | */ | |
5 | ||
6 | get_header(); ?> | |
7 | ||
8 | <div id="primary"> | |
9 | <div id="content" role="main"> | |
10 | ||
11 | <?php while ( have_posts() ) : the_post(); ?> | |
12 | ||
13 | <?php get_template_part( 'content', 'page' ); ?> | |
14 | ||
15 | <?php endwhile; // end of the loop. ?> | |
16 | ||
17 | ||
18 | <?php /* Start This is the Information Posts Area */ | |
19 | $temp_post = $post; // Store the Page the Post | |
20 | ||
21 | $wp_query= null; | |
22 | $wp_query = new WP_Query(); | |
23 | $args = array( | |
24 | 'post_type' => 'information', | |
25 | 'posts_per_page' => 2, | |
26 | 'order' => 'desc', | |
27 | 'paged' => $paged, | |
28 | ); | |
29 | $wp_query->query( $args ); | |
30 | ?> | |
31 | ||
32 | <?php if ( $wp_query->have_posts() ) : ?> | |
33 | ||
34 | - | <!-- Add Top Pagination Code Here --> |
34 | + | <?php /* Start wp-pagenavi support */ ?> |
35 | - | <?php twentyeleven_content_nav( 'nav-above' ); ?> |
35 | + | <?php if(function_exists('wp_pagenavi') ) : ?> |
36 | <?php wp_pagenavi(); ?> | |
37 | <?php else: ?> | |
38 | <?php twentyeleven_content_nav( 'nav-above' ); ?> | |
39 | <?php endif; ?><?php /* End wp-pagenavi support */ ?> | |
40 | ||
41 | <?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?> | |
42 | <div id="post-<?php the_ID(); ?>" <?php // post_class(); ?>> | |
43 | <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> | |
44 | <div class="entry-summary"> | |
45 | <?php the_excerpt(); ?> | |
46 | </div><!-- .entry-content --> | |
47 | - | <!-- Add Bottom Pagination Code Here --> |
47 | + | |
48 | - | <?php twentyeleven_content_nav( 'nav-below' ); ?> |
48 | + | |
49 | <?php endwhile; ?> | |
50 | ||
51 | <?php /* Start wp-pagenavi support */ ?> | |
52 | <?php if(function_exists('wp_pagenavi') ) : ?> | |
53 | <?php wp_pagenavi(); ?> | |
54 | <?php else: ?> | |
55 | <?php twentyeleven_content_nav( 'nav-below' ); ?> | |
56 | <?php endif; ?><?php /* End wp-pagenavi support */ ?> | |
57 | ||
58 | <?php endif; ?> | |
59 | ||
60 | <?php $post = $temp_post; // Reset the Post ?> | |
61 | ||
62 | </div><!-- #content --> | |
63 | </div><!-- #primary --> | |
64 | ||
65 | <?php get_footer(); ?> |