-
Notifications
You must be signed in to change notification settings - Fork 0
/
page-blog.php
66 lines (59 loc) · 1.56 KB
/
page-blog.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php /* Template Name: blog */ ?>
<?php get_header(); ?>
<div class="content-page blog">
<!-- HERO -->
<?php
if (have_posts()):
while (have_posts()): the_post();
?>
<section id="hero" class="hero">
<div class="row">
<div class="blurb">
<h1><?php the_title(); ?><span><?php the_content(); ?></span></h1>
</div>
</div>
<?php
if(types_render_field('header-image')){
$image_render = types_render_field('header-image');
$image = array();
preg_match( '/src="(.*?)"/i', $image_render, $image ) ;
$image[0] = $image[1];
} else if(has_post_thumbnail()){
$image = wp_get_attachment_image_src( get_post_thumbnail_id( ), 'full' );
}
?>
<div class="bg" style="background-image:url('<?php echo $image[0]; ?>'); background-size: cover; background-position: center center;">
</div>
</section>
<?php
endwhile;
endif;
wp_reset_query();
?>
<div class="pad-large"></div>
<!-- POST LIST -->
<section class="body">
<div class="row">
<div class="middle-line"></div>
<?php include 'sidebar.php' ?>
<div class="columns medium-9 post-list">
<?php
query_posts(array('category_name'=>'blog','order'=>'DESC','posts_per_page'=>'4','paged'=> $paged));
if (have_posts()):
?>
<!-- BLOG POST LIST -->
<?php include "inc/blogpost.php"; ?>
<!-- PAGINATION -->
<div class="pagination clearfix">
<?php if (function_exists('wp_corenavi')) wp_corenavi(); ?>
</div>
<?php
endif;
wp_reset_query();
?>
</div>
</div>
</section>
<div class="pad-large"></div>
</div>
<?php get_footer(); ?>