-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle.php
111 lines (100 loc) · 2.46 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?php
/**
* The Template for displaying all single posts
*/
$is_anthem = true;
if ( has_cmb_value( 'brand' ) ) {
if ( get_cmb_value( 'brand' ) == 'nwcua' ) {
$is_anthem = false;
}
}
get_header();
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
if ( in_category(7850) ) {
?>
<div class="large-title bg-navy">
<div class="wrap">
<div class="large-title-icon bg-navy">
<img src="/wp-content/uploads/2011/12/iconnwcua.png">
</div>
<div class="large-title-text">
<h1>Advocacy On The Move</h1>
</div>
</div>
</div>
<div class="cuobsessed-title">
<div class="wrap">
<h2>Updates from your NWCUA Advocacy Team</h2>
</div>
</div>
<div id="primary" class="site-content wrap">
<div id="content" class="site-content content-narrow content-style" role="main">
<div class="cuobsessed-post group">
<?php the_post_thumbnail(); ?>
<h2><?php the_title(); ?> - <?php the_date() ?></h2>
<p class="quiet"><?php the_author(); ?></p>
<?php the_content(); ?>
</div>
</div><!-- #content -->
</div><!-- #primary -->
<?php
} else {
?>
<div id="primary" class="site-content wrap">
<div id="content" class="site-content content-two-column content-style" role="main">
<div class="content-header">
<h1><?php the_title(); ?></h1>
<h2><?php the_excerpt(); ?></h2>
</div>
<div class="three-quarter right">
<?php
the_content();
$orig_post = $post;
global $post;
$categories = wp_get_post_categories( $post->ID );
if ( $categories ) {
$args=array(
'category__in' => $categories,
'post__not_in' => array( $post->ID ),
'posts_per_page' => 5, // Number of related posts to display.
'ignore_sticky_posts' => 1
);
$my_query = new wp_query( $args );
if ( $my_query->have_posts() ) {
?>
<hr />
<div class="relatedposts">
<h3>Related Posts</h3>
<ul>
<?php
while( $my_query->have_posts() ) {
$my_query->the_post();
?>
<li><a rel="external" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php
}
?>
</ul>
</div>
<?php
}
}
$post = $orig_post;
wp_reset_query();
?>
</div>
<div class="quarter sidebar right">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar-blog') ) : ?><!-- no sidebar --><?php endif; ?>
</div>
</div><!-- #content -->
</div><!-- #primary -->
<?php
}
}
}
?>
<?php
get_footer();
?>