-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage-resources.php
82 lines (51 loc) · 2.17 KB
/
page-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
<?php
/* Template Name: Resources Page */
get_header();
$thumbnail_url = wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) );
?>
<!-- FEATURE IMAGE
================================================== -->
<?php if( has_post_thumbnail() ) { // check for feature image ?>
<!--
<section class="feature-image" style="background: url('<?php echo $thumbnail_url; ?>') no-repeat; background-size: cover;" data-type="background" data-speed="2">
<h1 class="page-title"><?php the_title(); ?></h1>
</section>
<?php } else { // fallback image ?>
<section class="feature-image feature-image-default" data-type="background" data-speed="2">
<h1 class="page-title"><?php the_title(); ?></h1>
</section>
<?php } ?>
-->
<!-- MAIN CONTENT
================================================== -->
<div class="container">
<div class="row" id="primary">
<div id="content" class="col-sm-12">
<section class="main-content">
<?php while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; // end of the loop ?>
<?php $loop = new WP_Query( array( 'post_type' => 'resource', 'orderby'=>'post_id', 'order'=>'ASC' ) ); ?>
<hr>
<div class="resource-row clearfix">
<?php while( $loop->have_posts() ) : $loop->the_post(); ?>
<?php
$resource_image = get_field('resource_image');
$resource_url = get_field('resource_url');
$button_text = get_field('button_text');
?>
<div class="resource">
<img src="<?php echo $resource_image[url]; ?>" alt="<?php echo $resource_image[alt]; ?>">
<h3><a href="<?php echo $resource_url; ?>"><?php the_title(); ?></a></h3>
<?php the_content(); ?>
<?php if( !empty($button_text) ) : ?>
<a href="<?php echo $resource_url; ?>" class="btn btn-success"><?php echo $button_text; ?></a>
<?php endif; ?>
</div><!-- resource -->
<?php endwhile; ?>
</div><!-- resource-row -->
</section><!-- main-content -->
</div><!-- content -->
</div><!-- row -->
</div><!-- container -->
<?php get_footer(); ?>