-
Notifications
You must be signed in to change notification settings - Fork 0
/
a-archive-resources.php
87 lines (68 loc) · 2.17 KB
/
a-archive-resources.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
<?php
/**
* The template for displaying archive pages
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package regenerativechangelab
*/
/**
* ARCHIVE TOP BANNER
* This shows archive categories, tags, and search query results
* Also located on search.php */
if ( have_posts() ) :
get_template_part('template-parts/blog-intro-banner');
?>
<div class="container -wide">
<?php get_template_part('template-parts/blog-filter-dropdown');?>
</div>
<div class="resource__wrapper">
<div class="resource__wrapper-posts">
<div class="featuredPosts__blog">
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'post_type'=>'resources', // Your post type name
'posts_per_page' => 10,
'paged' => $paged,
);
$loop = new WP_Query( $args );
if ( $loop->have_posts() ) {
while ( $loop->have_posts() ) : $loop->the_post();
get_template_part('template-parts/blog-featured-post-card');
endwhile;
/* placeholders for keeping flex item spacing consistent */ ?>
<i class="featuredPosts__blog-spacer" aria-hidden="true"></i>
<i class="featuredPosts__blog-spacer" aria-hidden="true"></i>
<?php
}
wp_reset_postdata();
?>
</div>
<div class="pagination">
<?php regenerativechangelab_numeric_posts_nav(); ?>
</div>
</div>
<?php // Let's get those ACF variables
$resources_page = get_page_by_path( 'resources-content' );
$blog_intro_eyebrow = get_field('resource_ad_block', $resources_page);
if (!empty($blog_intro_eyebrow)) { ?>
<div class="-adBlock">
<div class="-adBlock-inner">
<span class="-eyebrow"><?php echo $blog_intro_eyebrow; ?></span>
</div>
</div>
<?php } ?>
</div>
<?php // get CTA / page content from Resources page
$get_resources_page = get_page_by_path( 'resources-content' );
$the_query = new WP_Query( $get_resources_page );
while ( $the_query->have_posts() ) :
$the_query->the_post();
the_content();
endwhile;
wp_reset_postdata();
else :
get_template_part( 'template-parts/content', 'none' );
endif;
?>