forked from victorianwaderstudygroup/vwsg-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfront-page.php
88 lines (79 loc) · 1.84 KB
/
front-page.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
/**
* Created by PhpStorm.
* User: Scott
* Date: 20/10/2018
* Time: 11:57 AM
*/
/**
* This is the static home-page template
*/
get_header();
?>
<div class="row">
<img class="banner" src="<?=get_template_directory_uri()?>/images/home-banner-1.jpg" role="presentation">
</div>
<div class="row features">
<?php
$i = 0;
$args = [
'category' => 6,
'numberposts' => 3,
'post_type' => 'page',
'orderby' => 'meta_value_num',
'meta_key' => 'home_position',
'order' => 'ASC'
];
foreach (get_posts($args) as $post) : setup_postdata($post); ?>
<a class="col-xs-12 col-sm-4 feature" href="<?php the_permalink(); ?>">
<?php if (has_post_thumbnail()) : ?>
<img src="<?php the_post_thumbnail_url('75'); ?>" class="feature-img" role="presentation">
<?php
endif;
?>
<span><?=the_title();?></span></a>
<?php
endforeach;
wp_reset_postdata();
?>
</div>
<div class="row">
<div class="col-xs-12 col-md-8 col-lg-8 main">
<?php
if (have_posts()) :
while (have_posts()) : the_post(); ?>
<h1><?php the_title() ?></h1>
<?php
the_content();
endwhile;
endif;
?>
</div>
<div class="col-xs-12 col-md-4 col-lg-4 news section">
<h2><i class="far fa-newspaper"></i> Latest News</h2>
<?php
$args = [
'posts_per_page' => 1,
'post_type' => 'post',
'orderby' => 'date',
'order' => 'DESC',
'category__in' => [
get_cat_ID('News'),
get_cat_ID('Uncategorised')
],
'category__not_in' => [get_cat_ID('Archive')]
];
$query = new WP_Query($args);
if ($query->have_posts()) {
while ($query->have_posts()) :
$query->the_post();
get_template_part('partial/news-item-compact');
endwhile;
}
wp_reset_postdata();
?>
<a class="more-news" href="/news-events">More news →</i></a>
</div>
</div>
<?php
get_footer();