SHOW:
|
|
- or go back to the newest paste.
1 | <?php get_header(); ?> | |
2 | ||
3 | <div id="container"> | |
4 | <div id="post_content"> | |
5 | <div class="main_adjust"> | |
6 | ||
7 | <!-- Grab posts --> | |
8 | <?php | |
9 | $cat = get_option('to_cat_home'); | |
10 | $per_page = get_option('to_count_home'); | |
11 | query_posts("cat=${cat}&posts_per_page=${per_page}&paged=".$paged); | |
12 | if (have_posts()) | |
13 | ?> | |
14 | <?php while (have_posts()) : the_post(); ?> | |
15 | ||
16 | ||
17 | <!-- Post formats --> | |
18 | <?php | |
19 | if(has_post_format('aside')) | |
20 | get_template_part('content', 'aside'); | |
21 | elseif ( has_post_format( 'chat' )) { | |
22 | get_template_part('content', 'chat'); | |
23 | } | |
24 | elseif ( has_post_format( 'gallery' )) { | |
25 | get_template_part('content', 'gallery'); | |
26 | } | |
27 | elseif ( has_post_format( 'image' )) { | |
28 | get_template_part('content', 'image'); | |
29 | } | |
30 | elseif ( has_post_format( 'link' )) { | |
31 | get_template_part('content', 'link'); | |
32 | } | |
33 | elseif ( has_post_format( 'quote' )) { | |
34 | get_template_part('content', 'quote'); | |
35 | } | |
36 | elseif ( has_post_format( 'status' )) { | |
37 | get_template_part('content', 'status'); | |
38 | } | |
39 | elseif ( has_post_format( 'video' )) { | |
40 | get_template_part('content', 'video'); | |
41 | } | |
42 | elseif ( has_post_format( 'audio' )) { | |
43 | get_template_part('content', 'audio'); | |
44 | } | |
45 | else { | |
46 | $format = get_post_format(); | |
47 | if ( false === $format ) { | |
48 | ?> | |
49 | ||
50 | <!-- Begin excerpt wrap --> | |
51 | <div class="excerpt_wrap"> | |
52 | <div class="excerpt_inside"> | |
53 | <?php if ( has_post_thumbnail() ) { ?><?php } ?> | |
54 | <a href="<?php the_permalink() ?>"> | |
55 | <?php the_post_thumbnail( 'thmb-index' ); ?> | |
56 | </a> | |
57 | <div class="excerpt_content<?php if ( has_post_thumbnail() ) echo ' with-thumbnail'; ?>"> | |
58 | <h1 class="index_title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1> | |
59 | <span class="sub-title">By <?php the_author_posts_link( ); ?> <span class="sub-title-divider">|</span> <?php the_time('F j, Y'); ?> <span class="sub-title-divider">|</span> <a href="<?php the_permalink(); ?>#respond"><?php comments_number( 'No comments', 'One comment', '% comments' ); ?></a></span> | |
60 | <?php the_excerpt(); ?> | |
61 | </div><!-- .excerpt_content --> | |
62 | ||
63 | <!-- End excerpt wrap --> | |
64 | </div> | |
65 | </div> | |
66 | ||
67 | <?php } // ending the if ( false === $format ) ... | |
68 | } // end else | |
69 | ?> | |
70 | ||
71 | <?php //NEW SECTION | |
72 | - | if( $wp_query->current_post == 1 ) : //for example: extra block after second excerpt |
72 | + | if( $wp_query->current_post == 1 ) : //for example: extra block after second excerpt ?> |
73 | <!-- use excerpt wrap to keep same structure --> | |
74 | <div class="excerpt_wrap"> | |
75 | <div class="excerpt_inside"> | |
76 | <?php | |
77 | /* | |
78 | /use whatever code you need for this section | |
79 | */ | |
80 | ?> | |
81 | ||
82 | </div><!-- End excerpt_inside --> | |
83 | </div><!-- End excerpt_wrap --> | |
84 | <?php endif; | |
85 | //end of NEW SECTION ?> | |
86 | ||
87 | <?php endwhile; ?> | |
88 | ||
89 | <!-- Next/Previous entries --> | |
90 | <div class="mp_archive"> | |
91 | <div id="more_posts"> | |
92 | <div class="oe"> | |
93 | <?php next_posts_link('« Older') ?> | |
94 | </div> | |
95 | <div class="re"> | |
96 | <?php previous_posts_link ('Newer »') ?> | |
97 | </div> | |
98 | </div> | |
99 | </div> | |
100 | ||
101 | </div> | |
102 | </div> | |
103 | <?php get_sidebar(); ?> | |
104 | </div> | |
105 | </div> | |
106 | ||
107 | <?php get_footer(); ?> | |
108 | ||
109 | ||
110 |