-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfront-page.php
112 lines (94 loc) · 4 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php get_header(); ?>
<!--
======= Start Hero section
-->
<section class="hero">
<div class="hero-img">
<img src="<?php echo get_template_directory_uri() . '/assets/src/images/1.jpg'; ?>" alt="">
</div>
<div class="hero-text">
<h1>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Et, eveniet!</h1>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Incidunt, molestias magni distinctio
magnam fuga possimus sapiente? Aliquid accusamus quaerat, vero harum magnam quo ipsa corrupti
modi iusto repudiandae, esse asperiores.
</div>
<div class="hero-social">
<a href="#">
<div class="icon-linkedin-square"></div>
</a>
<a href="#">
<div class="icon-github"></div>
</a>
<a href="#">
<div class="icon-facebook-square"></div>
</a>
<a href="#">
<div class="icon-youtube-play"></div>
</a>
</div>
</section>
<!--
======= Start Gallery section
-->
<section class="gallery">
<div class="filter">
<button class="btn active" data-filter="all">All</button>
<?php
$terms = get_terms([
'taxonomy' => 'category',
'hide_empty' => false,
]);
foreach ($terms as $term) { ?>
<button class="btn" data-filter="<?php echo $term->slug; ?>"><?php echo $term->name; ?></button>
<?php }
?>
</div>
<div class="items">
<?php
$args = array(
'post_type' => 'post',
// 'posts_per_page' => 6,
// 'paged' => get_query_var('paged', 1), //page number 1 on load
'post_status' => 'publish',
'category__not_in' => [1]
);
$wp_query = new WP_Query($args);
while ($wp_query->have_posts()) {
$wp_query->the_post();
$termsArray = get_the_terms($post->ID, 'category');
$termsSLug = "";
foreach ($termsArray as $term) {
$termsSLug .= $term->slug . ' ';
}
?>
<div class="item <?php echo $termsSLug; ?>">
<div class="item-image">
<a href="<?php the_permalink(); ?>">
<img src="<?php the_post_thumbnail_url(); ?>"
alt="<?php the_title_attribute(); ?>">
</a>
</div>
<div class="item-content">
<a href="<?php the_permalink(); ?>">
<h3 class="title">L<?php the_title(); ?></h3>
</a>
<p class="excerpt"><?php the_excerpt(); ?></p>
<!-- <div class="social-media">
<a href="#">
<div class="icon-eye"></div>
</a>
<a href="#">
<div class="icon-link"></div>
</a>
<a href="#">
<div class="icon-github"></div>
</a>
</div> -->
</div>
</div>
<?php }
wp_reset_postdata();
?>
</div>
</section>
<?php get_footer(); ?>