-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsidebar-resources.php
More file actions
51 lines (44 loc) · 1.42 KB
/
sidebar-resources.php
File metadata and controls
51 lines (44 loc) · 1.42 KB
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
<?php
/**
* The sidebar containing the main widget area
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package WP_Bootstrap_Starter
*/
if ( ! is_active_sidebar( 'sidebar-1' ) ) {
return;
}
?>
<aside id="secondary" class="widget-area col-10 offset-1 col-sm-12 col-lg-3 article-block__right-col mt-5" role="complementary">
<h3 class="">
More Opportunities
</h3>
<?php
$resources_args = array(
'post_type' => 'opportunity',
//'post__not_in' => $resources,
'posts_per_page' => '12',
'orderby' => 'date',
'order' => 'DESC'
);
$resources_posts = new WP_Query( $resources_args );
if ($resources_posts->have_posts() ) {
while ( $resources_posts->have_posts() ) {
$resources_posts->the_post();
?>
<article class="resource-post">
<a href="<?php the_permalink(); ?>"><?php the_title('<h6>','</h6>') ?></a>
<?php
// Get field label and value for class name and span content
$resource_type_field = get_field_object('resource_type');
$resource_type_value = $resource_type_field['value'];
$resource_type_label = $resource_type_field['choices'][$resource_type_value];
?>
<a class="<?php echo $resource_type_value ?> resource-type" href="<?php echo home_url().'/'.$resource_type_value.'s' ?>"><?php echo $resource_type_label ?></a>
</article>
<?php
};
};
?>
</aside><!-- #secondary -->