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