|
1 <?php get_header(); ?> |
|
2 |
|
3 <?php get_sidebar(); ?> |
|
4 |
|
5 <div id="content"> |
|
6 <?php |
|
7 if (have_posts()) : |
|
8 while (have_posts()) : the_post(); |
|
9 setup_postdata($post); |
|
10 // Fetch the PermaLink, Thumbnail and Video Metas |
|
11 $get_post_video = get_post_meta($post->ID, "main_video", true); |
|
12 $get_thumbnail = get_post_meta($post->ID, "other_media", true); |
|
13 $link = get_permalink($post->ID); |
|
14 // Set our category |
|
15 $category = get_the_category(); |
|
16 // If we haven't used our custom image input, search for the first image in the post |
|
17 $post_image = ""; |
|
18 if($get_thumbnail == "" && (get_option("ocmx_auto_home_images") && get_option("ocmx_auto_home_images") !== "no")) : |
|
19 $post_image = fetch_post_image($post->ID, "560", "2000"); |
|
20 endif; |
|
21 |
|
22 ?> |
|
23 <div class="post"> |
|
24 <h4 class="date"><?php echo date('d M Y', strtotime($post-> post_date)); ?></h4> |
|
25 <h2 class="title"><a href="<?php echo $link; ?>"><?php the_title(); ?></a></h2> |
|
26 <div class="container-header-light-normal"><span></span></div> |
|
27 <div class="copy clearfix"> |
|
28 <?php if($get_post_video !== "") : |
|
29 $get_post_video = preg_replace("/(width\s*=\s*[\"\'])[0-9]+([\"\'])/i", "$1 560 $2", $get_post_video); |
|
30 $get_post_video = preg_replace("/(height\s*=\s*[\"\'])[0-9]+([\"\'])/i", "$1 312 $2", $get_post_video); |
|
31 ?> |
|
32 <div class="media"> |
|
33 <?php echo $get_post_video; ?> |
|
34 </div> |
|
35 <?php elseif ($post_image !== "") : ?> |
|
36 <div class="media"> |
|
37 <?php echo $post_image; ?> |
|
38 </div> |
|
39 <?php elseif ($get_thumbnail !== "") : ?> |
|
40 <div class="media"> |
|
41 <img src="<?php bloginfo('template_directory'); ?>/functions/timthumb.php?src=<?php echo $get_thumbnail ?>&h=&w=560&zc=1" alt="<?php the_title(); ?>" /> |
|
42 </div> |
|
43 <?php endif; |
|
44 if($post->post_excerpt !== "") : |
|
45 the_excerpt(); |
|
46 else : |
|
47 the_content(); |
|
48 endif; ?> |
|
49 |
|
50 <?php if (comments_open()) : ?> <a href="<?php echo $link;?>#comments" class="post-comments"><?php echo $post->comment_count; ?> Comments</a><?php endif; ?> |
|
51 <a href="<?php echo $link;?>" class="action-link"><span>Continue reading</span></a> |
|
52 </div> |
|
53 <div class="container-footer-light-normal"><span></span></div> |
|
54 </div> |
|
55 <?php |
|
56 endwhile; |
|
57 /* Pagination */ |
|
58 ocmx_pagination(); |
|
59 else: |
|
60 ?> |
|
61 <div class="post"> |
|
62 <h4 class="date">This just happened.</h4> |
|
63 <h2 class="title"><a href="#">Everyone needs to slow down</a></h2> |
|
64 <div class="container-header-light-normal"><span></span></div> |
|
65 <div class="copy clearfix">There are no posts which match your criterea.</div> |
|
66 <div class="container-footer-light-normal"><span></span></div> |
|
67 </div> |
|
68 <?php |
|
69 endif; |
|
70 ?> |
|
71 |
|
72 </div> |
|
73 |
|
74 <?php get_footer(); ?> |