-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpage-blog.php
130 lines (130 loc) · 3.57 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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?php
get_header('blog'); ?>
<div id="banner-blog">
<div class="container">
<?php
$i = 1;
$args = array(
'posts_per_page' => 4,
'orderby' => 'post_date',
'order' => 'DESC',
'category_name' => 'destaque');
$query = new WP_Query( $args );
if ( $query->have_posts() ) : ?>
<div class="row">
<?php while ( $query->have_posts() ) : $query->the_post();
if($i == 1):
?>
<div class="col-lg-6 align-self-center">
<article>
<span class="cat">
<?php
$categories = get_the_category();
$category = $categories[0]->name;
echo $category;
?>
</span>
<h1><?php the_title(); ?></h1>
<div class="big subtitle">
<?php echo get_excerpt_custom(140); ?>
</div><br>
<a href="<?php the_permalink(); ?>" class="btn-base btn-white" title="">
Saiba mais
</a>
</article>
</div>
<div class="col-lg-4 offset-lg-2">
<div class="row">
<?php
else:
?>
<div class="col-12">
<article>
<a href="<?php the_permalink(); ?>" title="">
<h5><?php the_title(); ?></h5>
<p> <?php the_excerpt(); ?></p>
</a>
</article>
</div>
<?php
endif;
$i++;
endwhile;
?>
</div>
</div>
</div>
<?php
endif;
?>
</div>
<div class="subs-box">
<div class="container">
<div class="subs-container">
<?php
$page = get_page_by_path( 'blog' );
echo do_shortcode(get_field('blog_newsletter', $page->ID));
?>
</div>
</div>
</div>
</div>
<div id="page" class="blog">
<div class="blog-category">
<div class="container">
<div class="row">
<?php
$categories = get_categories();
foreach($categories as $category) {
if($category->name != 'Sem categoria'):
echo '<div class="col-auto"><a class="post-cat" data-id='.$category->cat_ID.' href="#">' . $category->name . '</a></div>';
endif;
}
?>
</div>
</div>
</div>
<div class="blog-posts">
<div class="container">
<div class="row blog-posts-list">
</div>
<div class="row btn-mais"></div>
</div>
</div>
<div class="blog-materiais wow animated fadeIn">
<div class="container">
<h2>Materiais educativos</h2>
<?php
$args = array(
'posts_per_page' => 6,
'orderby' => 'post_date',
'order' => 'DESC',
'category_name' => 'ebooks');
$query = new WP_Query( $args );
if ( $query->have_posts() ) : ?>
<div class="row">
<?php while ( $query->have_posts() ) : $query->the_post(); ?>
<article class="col-lg-4 col-sm-6">
<a href="<?php the_permalink(); ?>" title="">
<div class="row">
<div class="col-sm-4 mb-4 mb-sm-0">
<?php
the_post_thumbnail('blog-thumb', array(
'class' => "img-fluid",
))
?>
</div>
<div class="col-sm-8 align-self-center">
<h5><?php the_title(); ?></h5>
<p><?php the_excerpt_custom(20); ?></p>
</div>
</div>
</a>
</article>
<?php endwhile; ?>
</div>
<?php endif; ?>
</div>
</div>
</div>
<?php get_footer(); ?>