-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsingle.php
70 lines (41 loc) · 1.09 KB
/
single.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
<?php
/**
* The single post template file
*
* @package AccessibleMinimalism
*/
get_header();
$category = get_queried_object();
echo get_cat_name( $category->term_id );
echo "SINGLE POST";
if ( have_posts() ) {
?>
<?php
// Load posts loop.
while ( have_posts() ) {
the_post();
the_title('<h2>', '</h2>');
?>
<p><i>published by <?php the_author(); ?> on <?php echo get_the_date(); ?></i></p>
<?php
the_content();
global $post;
if( has_category( 'resources', $post ) ) {
echo '<b>Resource meta</b>';
$fields = get_fields();
if( $fields ): ?>
<ul>
<?php foreach( $fields as $name => $value ): ?>
<li><b><?php echo $name; ?></b> <?php echo $value; ?></li>
<?php endforeach; ?>
</ul>
<?php endif;
}
} // end posts loop
?>
<?php
} else {
echo "<h2>No content found</h2>";
echo "<p>Put something here</p>";
}
get_footer();