-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpage-tutorials.php
More file actions
67 lines (48 loc) · 1.68 KB
/
page-tutorials.php
File metadata and controls
67 lines (48 loc) · 1.68 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php $section = 'resources'; ?>
<?php get_header(); ?>
<?php if ( have_posts() ) : ?>
<?php
/* Start the Loop */
while ( have_posts() ) : the_post();
$page_class = sanitize_title(get_the_title());
$page_class = strtolower($page_class);
?>
<section id="main" class="<?php echo $page_class;?> text-content">
<section id="tutorials" class="main-col">
<h2>Recent Tutorials</h2>
<?php
$args = array(
'post_type' => 'resource',
'meta_key' => 'resource_type',
'meta_value' => 'tutorial',
'orderby' => 'post_date',
'order' => 'ASC'
);
$query = new WP_Query( $args );
while($query->have_posts()) {
$query->the_post();
?>
<article class="tutorial">
<a href="<?php echo get_permalink(); ?>"><?php echo wp_get_attachment_image(get_field('resource_image'), 'tutorial-thumb'); ?></a>
<div class="info">
<h4 class="meta-info">Posted <?php echo get_the_date(); ?> by <a><?php echo get_the_author(); ?></a> | <?php comments_number(); ?></h4>
<h3><a href="<?php echo get_permalink(); ?>"><?php echo get_the_title(); ?></a></h3>
<?php the_excerpt(); ?>
<footer>
Level: <span class="level"><?php badge_level_name(get_field('resource_level')); ?></span>
<span class="approval">12 growers found this useful</span>
</footer>
</div>
</article>
<?php } ?>
</section><!--#discussions-->
<?php
// print post results
//the_title();
endwhile;
?>
<?php else : ?>
Oops. No content found.
<?php endif; ?>
</section><!-- #main -->
<?php get_footer(); ?>