-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathsingle.php
220 lines (117 loc) · 6.61 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<?php get_header(); ?>
<div class="content">
<?php if ( have_posts() ) :
while ( have_posts() ) : the_post();
$wAuthor = ( get_post_meta( $post->ID, 'wAuthor', 1 )) ? get_post_meta( $post->ID, 'wAuthor', 1 ) : get_the_author() ;
?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if ( has_post_thumbnail() ) : ?>
<div class="featured-media" style="background-image: url( <?php the_post_thumbnail_url( $post->ID, 'post-image' ); ?> );">
<?php
the_post_thumbnail( 'post-image' );
$image_caption = get_post( get_post_thumbnail_id() )->post_excerpt;
if ( $image_caption ) :
?>
<div class="media-caption-container">
<p class="media-caption"><?php echo $image_caption; ?></p>
</div>
<?php endif; ?>
</div><!-- .featured-media -->
<?php endif; ?>
<div class="post-header section">
<div class="post-header-inner section-inner medium">
<p class="post-meta-top">
<a href="<?php the_permalink(); ?>" title="<?php the_time( get_option( 'time_format' ) ); ?>"><?php the_time( get_option( 'date_format' ) ); ?></a>
<?php if ( comments_open() and truwriter_option('allow_comments') ) : ?>
<span class="sep">/</span>
<?php comments_popup_link( __( '0 comments', 'radcliffe' ), __( '1 comment', 'radcliffe' ), __( '% comments', 'radcliffe' ), 'post-comments' ); ?>
<?php endif; ?>
<?php echo truwriter_get_reading_time('<span class="sep">/</span> Reading Time:', '');?>
</p>
<?php the_title( '<h1 class="post-title">', '</h1>' ); ?>
<p class="theauthor"><?php echo twitternameify( $wAuthor );?></p>
</div><!-- .post-header-inner section-inner -->
</div><!-- .post-header section -->
<div class="post-content section-inner <?php truwriter_layout_width()?>">
<?php if ( truwriter_is_preview() ) echo truwriter_preview_notice(); // preview notice ?>
<?php the_content(); ?>
<?php
if (truwriter_option('show_footer') ) {
$wFooter = get_post_meta( $post->ID, 'wFooter', 1 );
if ($wFooter) echo '<p><em>' . make_clickable( $wFooter ) . '</em></p>';
}
if ( truwriter_is_preview() ) echo truwriter_preview_notice();
?>
<div class="clear"></div>
<?php wp_link_pages('before=<p class="page-links">' . __('Pages:','radcliffe') . ' &after=</p>&separator=<span class="sep">/</span>'); ?>
</div>
<div class="post-meta section-inner <?php truwriter_layout_width()?>">
<div class="meta-block post-author">
<h3 class="meta-title"><?php truwriter_metadate_heading() ?></h3>
<div class="post-author-container">
<img src="<?php echo get_stylesheet_directory_uri();?>/images/writer.png" class="avatar avatar-160 photo" height="160" width="160" alt="" />
<div class="post-author-inner">
<?php if ($wAuthor) :?>
<p class="author-description"><strong>Author:</strong>
<?php echo '<a href="' . get_site_url() . '/?writer=' . urlencode($wAuthor) . '">' . $wAuthor . '</a>' ; ?>
</p>
<?php endif?>
<p class="author-description"><strong>Published:</strong> <?php the_time(get_option('date_format')); ?></p>
<p class="author-description"><strong>Word Count:</strong> <?php echo truwriter_word_count( get_the_content() );?> </p>
<?php
// output estimated reading time if we are using plugin
echo truwriter_get_reading_time('<p class="author-description"><strong>Reading time:</strong>', '</p>');
// show the request edit link button if option set and they have provided an email and post is published
if ( truwriter_option('show_email') and get_post_meta( $post->ID, 'wEmail', 1 ) and get_post_status() == 'publish' ) {
echo '<p class="author-description"><strong>Edit Link:</strong> <em>(emailed to author)</em><br /> <a href="#" id="getEditLink" class="pretty-button pretty-button-final" data-widurl="' . get_bloginfo('url') . '/get-edit-link/' . $post->ID . '">Request Now</a> <span id="getEditLinkResponse" class="writenew"></span></p>';
}
?>
<?php if ( truwriter_option( 'use_cc' ) != 'none' AND get_post_meta($post->ID, 'wLicense', true) ):?>
<!-- creative commons -->
<p class="author-description"><strong><?php truwriter_form_item_license()?>: </strong><br />
<?php
// get the license code, either define for site or post meta for user assigned
$cc_code = ( truwriter_option( 'use_cc' ) == 'site') ? truwriter_option( 'cc_site' ) : get_post_meta($post->ID, 'wLicense', true);
echo truwriter_license_html( $cc_code, $wAuthor, get_the_time( "Y", $post->ID ) );
?>
</p> <!-- /creative commons -->
<?php endif?>
<?php if ( truwriter_option('show_tweet_button') ):?>
<p class="author-description"><strong>Share: </strong> <a href="https://twitter.com/share" class="twitter-share-button" data-hashtags="<?php echo truwriter_option( 'hashtags' )?>"
<a href="https://twitter.com/share" class="twitter-share-button" data-text="<?php echo addslashes(get_the_title())?> by <?php echo $wAuthor?>" data-hashtags="<?php echo truwriter_option( 'hashtags' )?>" data-dnt="true">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script></p>
<?php endif?>
</div>
<div class="clear"></div>
</div>
</div> <!-- /post-author -->
<div class="meta-block post-cat-tags">
<h3 class="meta-title"><?php _e('ORGANIZED BY','radcliffe'); ?></h3>
<?php if (truwriter_option('show_cats') ):?>
<p class="post-categories">
<?php the_category(', '); ?>
</p>
<?php endif?>
<?php if (truwriter_option('show_tags') ):?>
<?php if ( has_tag() ) : ?>
<p class="post-tags">
<?php the_tags('', ', '); ?>
</p>
<?php endif; ?>
<?php endif?>
<div class="post-nav">
<h3 class="meta-title"><?php _e('MORE TO READ','radcliffe'); ?></h3>
<?php the_post_navigation( array( 'class' => 'post-nav' ) );?>
<div class="clear"></div>
</div> <!-- /post-nav -->
</div> <!-- /post-cat-tags -->
<div class="clear"></div>
</div> <!-- /post-meta -->
</div> <!-- /post -->
<?php
if ( truwriter_option('allow_comments') ) comments_template( '', true );
endwhile;
endif; ?>
</div> <!-- /post -->
</div> <!-- /content -->
<?php get_footer(); ?>