forked from PressWork/PressWork
/
actions.php
executable file
·650 lines (618 loc) · 21.7 KB
/
actions.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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
<?php
/**
* The action hooks. This is where functions are hooked into certain
* action calls.
*
* @since PressWork 1.0
*/
?>
<?php
/*
* The Header
*/
function pw_header_content() {
?>
<ul id="headerbanner" class="fl clear">
<?php
$layout = pw_theme_option('header_option');
$layout = explode(",", $layout);
foreach($layout as $elem) {
pw_get_element($elem);
}
?>
</ul> <!-- end headerbanner -->
<?php
}
add_action('pw_header_middle', 'pw_header_content');
/*
* Social Icons
*/
function pw_social_content() {
$twitter = pw_theme_option('twitter');
$facebook = pw_theme_option('facebook');
$flickr = pw_theme_option('flickr');
$linkedin = pw_theme_option('linkedin');
$googleplus = pw_theme_option('googleplus');
$stumbleupon = pw_theme_option('stumbleupon');
echo '<div id="social-icons">';
if(!empty($twitter))
echo '<a href="http://twitter.com/'.$twitter.'" class="twitter-icon"></a>';
if(!empty($facebook))
echo '<a href="http://facebook.com/'.$facebook.'" class="facebook-icon"></a>';
if(!empty($flickr))
echo '<a href="http://www.flickr.com/photos/'.$flickr.'" class="flickr-icon"></a>';
if(!empty($googleplus))
echo '<a href="https://plus.google.com/'.$googleplus.'" class="googleplus-icon"></a>';
if(!empty($linkedin))
echo '<a href="http://www.linkedin.com/in/'.$linkedin.'" class="linkedin-icon"></a>';
if(!empty($stumbleupon))
echo '<a href="http://www.stumbleupon.com/stumbler/'.$stumbleupon.'" class="stumbleupon-icon"></a>';
echo '</div>';
}
add_action('pw_header_top', 'pw_social_content');
/*
* The Footer
*/
function pw_footer_content() {
?>
<ul id="footer" class="fl clear">
<?php
$layout = pw_theme_option('footer_option');
$layout = explode(",", $layout);
foreach($layout as $elem) {
pw_get_element($elem);
}
?>
</ul> <!-- end #footer -->
<?php
}
add_action('pw_footer_middle', 'pw_footer_content');
/*
* The first sidebar
*/
function pw_sidebar() {
echo pw_function_handle(__FUNCTION__);
if(!dynamic_sidebar("first-sidebar")) :
echo '<aside class="side-widget default">';
get_search_form();
echo '</aside>';
$args = array(
'before_widget' => '<aside class="side-widget default">',
'after_widget' => "</aside>",
'before_title' => '<header><h3>',
'after_title' => '</h3></header>',
);
$featured = new PW_Featured_Posts_Widget;
$instance = array( 'title' => 'Featured Posts', 'category' => '0', 'number' => '2' );
$featured->widget($args, $instance);
$tweet = new PW_Twitter_Widget;
$instance = array( 'title' => 'Latest Tweets', 'username' => '', 'link' => 'Follow Us', 'number' => '3' );
$tweet->widget($args, $instance);
if(current_user_can('edit_theme_options')) {
echo '<aside class="warning clear fl"><p>';
printf(__("Add your own widgets to the First Sidebar %shere%s", "presswork"), '<a href="'.admin_url('widgets.php').'">', '</a>');
echo '</p></aside>';
}
endif;
}
add_action('pw_sidebar_middle', 'pw_sidebar');
/*
* The second sidebar
*/
function pw_second_sidebar() {
echo pw_function_handle(__FUNCTION__);
if(!dynamic_sidebar("second-sidebar" ) && current_user_can('edit_theme_options')) :
echo '<aside class="warning clear fl"><p>';
printf(__("Add widgets to the Second Sidebar %shere%s", "presswork"), '<a href="'.admin_url('widgets.php').'">', '</a>');
echo '</p></aside>'; endif;
}
add_action('pw_second_sidebar_middle', 'pw_second_sidebar');
/*
* Top Content Widgetized Area
*/
function pw_top_content_widgetized_area() {
global $paged;
if($paged < 2) {
echo pw_function_handle(__FUNCTION__);
dynamic_sidebar("top-index-area" );
}
}
add_action('pw_index_top', 'pw_top_content_widgetized_area');
/*
* Basic Loop
*/
function pw_loop() {
get_template_part( 'loop');
}
add_action('pw_index_middle','pw_loop');
add_action('pw_single_middle', 'pw_loop');
add_action('pw_page_middle', 'pw_loop');
add_action('pw_archive_middle', 'pw_loop');
add_action('pw_category_middle', 'pw_loop');
add_action('pw_author_middle', 'pw_loop');
add_action('pw_search_middle', 'pw_loop');
/*
* Pagination
*/
function pw_pagination() {
echo pw_function_handle(__FUNCTION__);
pw_paginate();
}
add_action('pw_index_bottom', 'pw_pagination');
add_action('pw_archive_bottom', 'pw_pagination');
add_action('pw_author_bottom', 'pw_pagination');
add_action('pw_category_bottom', 'pw_pagination');
add_action('pw_search_bottom', 'pw_pagination');
/*
* This is the 404 page
*/
function pw_404() {
echo pw_function_handle(__FUNCTION__);
?>
<article id="post-0" class="post error404 not-found">
<header>
<h1 class="posttitle"><?php _e("Not found", "presswork"); ?></h1>
</header>
<div class="entry">
<p><?php _e("No results were found for your request.", "presswork"); ?></p>
</div>
</article>
<?php
}
add_action('pw_404_middle', 'pw_404');
/*
* Archive header
*/
function pw_archive_title() {
echo pw_function_handle(__FUNCTION__);
if (have_posts()) {
?>
<header>
<h1 class="catheader">
<?php
if( is_tag() ) { ?>
<?php printf(__("Posts Tagged ‘%s’", "presswork"), single_tag_title('',false)); ?>
<?php
} elseif (is_day()) { ?>
<?php _e("Archive for", "presswork"); echo " "; the_time('F jS, Y'); ?>
<?php
} elseif (is_month()) { ?>
<?php _e("Archive for", "presswork"); echo " "; the_time('F, Y'); ?>
<?php
} elseif (is_year()) { ?>
<?php _e("Archive for", "presswork"); echo " "; the_time('Y'); ?>
<?php
} elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<?php _e("Blog Archives", "presswork"); ?>
<?php
}
?>
</h1>
</header>
<?php
} else {
echo "<header><h1 class='posttitle'>".__("No posts found.", "presswork")."</h1></header>";
}
}
add_action('pw_archive_top', 'pw_archive_title');
/*
* Category header
*/
function pw_category_title() {
echo pw_function_handle(__FUNCTION__);
if (have_posts()) { ?>
<header>
<h1 class="catheader"><?php single_cat_title(); ?></h1>
<?php $catdesc = category_description(); if(stristr($catdesc,'<p>')) echo '<div class="catdesc clear">'.$catdesc.'</div>'; ?>
</header>
<?php
} else {
echo "<header><h1 class='posttitle'>".__("No posts found.", "presswork")."</h1></header>";
}
}
add_action('pw_category_top', 'pw_category_title');
/*
* Author header
*/
function pw_author_title() {
echo pw_function_handle(__FUNCTION__);
if (have_posts()) {
pw_authorbox();
} else {
echo "<header><h1 class='posttitle'>".__("No posts found.", "presswork")."</h1></header>";
}
}
add_action('pw_author_top', 'pw_author_title');
/*
* Top of comments section
*/
function pw_comment_section_title() {
echo pw_function_handle(__FUNCTION__);
echo '<h3 id="comments-title">';
printf( _n( 'One Response to %2$s', '%1$s Responses to %2$s', get_comments_number(), "presswork" ), number_format_i18n( get_comments_number() ), '<em>' . get_the_title() . '</em>' );
echo '</h3>';
}
add_action('pw_comments_top', 'pw_comment_section_title');
/*
* Comment middle section
*/
function pw_comment_section() {
echo pw_function_handle(__FUNCTION__);
?>
<ol class="commentlist">
<?php wp_list_comments( array( 'callback' => 'pw_comment_template', 'reply_text' => __('Reply', "presswork") ) ); ?>
</ol>
<?php
}
add_action('pw_comments_middle', 'pw_comment_section');
/*
* Comment navigation
*/
function pw_comment_navigation() {
echo pw_function_handle(__FUNCTION__);
if ( get_comment_pages_count() > 1 ) { ?>
<nav class="navigation">
<h1 class="assistive-text"><?php _e( 'Comment navigation', 'presswork' ); ?></h1>
<div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', "presswork" ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', "presswork" ) ); ?></div>
</nav>
<?php
}
}
add_action('pw_comments_nav_top', 'pw_comment_navigation');
add_action('pw_comments_nav_bottom', 'pw_comment_navigation');
/*
* Comment reply section
*/
function pw_comment_section_reply() {
echo pw_function_handle(__FUNCTION__);
$args = array(
'comment_notes_after' => '',
'comment_field' => '<p class="comment-form-comment"><textarea id="comment" name="comment" required cols="45" rows="8" placeholder="'.__("Your comment", "presswork").' *" aria-required="true"></textarea></p>'
);
comment_form($args);
}
add_action('pw_comments_reply', 'pw_comment_section_reply');
/*
* Search page title
*/
function pw_search_title() {
echo pw_function_handle(__FUNCTION__);
global $wp_query;
$total_results = $wp_query->found_posts;
echo '<h1 class="catheader">'.$total_results.' '.__('search results for', "presswork").' "'; the_search_query(); echo '"</h1>';
}
add_action('pw_search_top', 'pw_search_title');
/*
* Home page featured query
*
* @since PressWork 1.0.3
*/
function pw_home_page_featured_query() {
global $post, $notin, $paged, $pw;
$pw = 1;
$sticky = get_option( 'sticky_posts' );
$notin = pw_notin();
if(!empty($sticky)) {
if(!empty($notin)) $notin = array_merge($notin, $sticky); else $notin = $sticky;
if($paged < 2) {
$args = array(
'post__in' => $sticky,
'ignore_sticky_posts' => 1
);
$the_query = new WP_Query( $args );
while ( $the_query->have_posts() ) : $the_query->the_post();
?>
<article id="post-<?php the_ID(); ?>" <?php post_class("pw pw".$pw); ?>>
<?php pw_actionBlock('pw_index_sticky_post'); ?>
</article>
<?php
$pw++;
endwhile;
wp_reset_query();
}
} else {
$args = array(
'post__not_in' => $notin,
'posts_per_page' => 2
);
$the_query = new WP_Query( $args );
while ( $the_query->have_posts() ) : $the_query->the_post();
if($paged < 2) {
$notin[] = $post->ID;
?>
<article id="post-<?php the_ID(); ?>" <?php post_class("pw pw".$pw); ?>>
<?php pw_actionBlock('pw_index_featured_post'); ?>
</article>
<?php
$pw++;
} else {
$notin[] = $post->ID;
}
endwhile;
wp_reset_query();
}
query_posts( array( 'post__not_in' => $notin, "paged" => $paged ) );
}
add_action('pw_home_page', 'pw_home_page_featured_query');
/*
* Featured posts
*/
function pw_posts_featured() {
echo pw_function_handle(__FUNCTION__);
global $pw;
$rightcon = '';
if(function_exists('has_post_thumbnail') && has_post_thumbnail() && (function_exists('has_post_format') && !has_post_format('gallery') && !has_post_format('video'))) {
echo '<a href="'.get_permalink().'">';
if($pw==1) { $thumb = 'sticky'; $class = 'alignnone'; } else { $thumb = 'thumbnail'; $class = 'alignleft'; }
the_post_thumbnail($thumb, array('class'=>$class));
echo '</a>';
$rightcon = ' class="content-col"';
}
?>
<div<?php echo $rightcon; ?>>
<header>
<hgroup>
<h1 class="posttitle"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', "presswork" ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
<h2 class="meta">
<?php
_e("by", "presswork"); echo " "; the_author_posts_link();
echo ' • ';
the_time(get_option('date_format'));
if(comments_open()) { echo ' • '; comments_popup_link(__('0 Comments', "presswork"),__('1 Comment', "presswork"),__('% Comments', "presswork")); }
?>
</h2>
</hgroup>
</header>
<div class="storycontent">
<?php
if(function_exists('has_post_format') &&
(has_post_format('aside') || has_post_format('link') || has_post_format('video') || has_post_format('image') || has_post_format('audio'))) {
// new aside || link || audio || video || image post format
echo '<div class="pformat clear">';
the_content('');
echo '</div>';
} elseif(function_exists('has_post_format') && has_post_format('gallery')) { // new gallery post format
global $post;
$images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
if ( $images ) :
$total_images = count( $images );
$image = array_shift( $images );
$image_img_tag = wp_get_attachment_image( $image->ID, 'full' );
?>
<a class="gallery-thumb" href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a>
<p class="gallery-text clear fl"><em><?php printf( _n( 'This gallery contains <a %1$s>%2$s photo →</a>', 'This gallery contains <a %1$s>%2$s photos →</a>', $total_images, "presswork" ),
'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', "presswork" ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',
number_format_i18n( $total_images )
); ?></em>
</p>
<?php endif; ?>
<?php
} else {
the_excerpt();
echo '<a href="'.get_permalink().'" class="more-link">'.__("Read more →", "presswork").'</a>';
?>
<?php } ?>
</div>
</div>
<?php
}
add_action('pw_index_sticky_post_middle', 'pw_posts_featured');
add_action('pw_index_featured_post_middle', 'pw_posts_featured');
/*
* Posts
*/
function pw_posts() {
echo pw_function_handle(__FUNCTION__);
?>
<header>
<hgroup>
<h1 class="posttitle"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', "presswork" ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
<h2 class="meta">
<?php
_e("by", "presswork"); echo " "; the_author_posts_link();
echo ' • ';
the_time(get_option('date_format'));
if(!is_home()) {
echo ' • ';
the_category(', ');
}
if(comments_open()) { echo ' • '; comments_popup_link(__('0 Comments', "presswork"),__('1 Comment', "presswork"),__('% Comments', "presswork")); }
?>
</h2>
</hgroup>
</header>
<div class="storycontent">
<?php
if(function_exists('has_post_format') &&
(has_post_format('aside') || has_post_format('link') || has_post_format('video') || has_post_format('image') || has_post_format('audio'))) {
// new aside || link || audio || video || image post format
echo '<div class="pformat clear">';
if(function_exists('has_post_format') && has_post_format('image')) {
if(function_exists('has_post_thumbnail') && has_post_thumbnail()) {
echo '<a href="'.get_permalink().'">';
the_post_thumbnail('medium', array('class'=>'alignleft'));
echo '</a>';
} else {
the_content('');
}
} else {
the_content('');
}
echo '</div>';
} elseif(function_exists('has_post_format') && has_post_format('gallery')) { // new gallery post format
global $post;
$images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
if ( $images ) :
$total_images = count( $images );
$image = array_shift( $images );
$image_img_tag = wp_get_attachment_image( $image->ID, 'full' );
?>
<a class="gallery-thumb" href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a>
<p class="gallery-text clear fl"><em><?php printf( _n( 'This gallery contains <a %1$s>%2$s photo →</a>', 'This gallery contains <a %1$s>%2$s photos →</a>', $total_images, "presswork" ),
'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', "presswork" ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',
number_format_i18n( $total_images )
); ?></em>
</p>
<?php endif; ?>
<?php
} else {
if(function_exists('has_post_thumbnail') && has_post_thumbnail()) {
echo '<a href="'.get_permalink().'">';
if(is_home()) $thumb = 'fifty'; else $thumb = 'thumbnail';
the_post_thumbnail($thumb, array('class'=>'alignleft'));
echo '</a>';
}
the_excerpt();
}
if(function_exists('has_post_format') && (has_post_format('aside') || has_post_format('link') || has_post_format('gallery'))) { // new aside || link post format
// do nothing
} else {
echo '<a href="'.get_permalink().'" class="more-link">'.__("Read more →", "presswork").'</a>';
}
?>
</div>
<?php
}
add_action('pw_archive_post_middle', 'pw_posts');
add_action('pw_author_post_middle', 'pw_posts');
add_action('pw_category_post_middle', 'pw_posts');
add_action('pw_search_post_middle', 'pw_posts');
add_action('pw_index_post_middle', 'pw_posts');
/*
* Single post
*/
function pw_single_post() {
echo pw_function_handle(__FUNCTION__);
?>
<header>
<?php if(is_single()) echo '<hgroup>'; ?>
<h1 class="posttitle"><?php the_title(); ?></h1>
<?php if(is_single()) { ?>
<h2 class="meta">
<?php
_e("by", "presswork"); echo " "; the_author_posts_link();
echo ' • ';
the_time(get_option('date_format'));
echo ' • ';
the_category(', ');
if(comments_open()) { echo ' • '; comments_popup_link(__('0 Comments', "presswork"),__('1 Comment', "presswork"),__('% Comments', "presswork")); }
?>
</h2>
<?php } ?>
<?php if(is_single()) echo '</hgroup>'; ?>
</header>
<div class="storycontent">
<?php the_content( __( 'Read more →', "presswork" ) ); ?>
</div>
<footer>
<?php
the_tags('<p class="tags"><small>'.__('Tags', "presswork").': ', ', ', '</small></p>');
wp_link_pages(array('before' => '<p><strong>'.__('Pages', "presswork").':</strong> ', 'after' => '</p>', 'next_or_number' => 'number'));
edit_post_link(__('(edit)', "presswork"), '<p class="clear">', '</p>');
?>
</footer>
<?php
}
add_action('pw_single_post_middle', 'pw_single_post');
add_action('pw_page_post_middle', 'pw_single_post');
/*
* Author box
*/
function pw_authorbox() {
echo pw_function_handle(__FUNCTION__);
global $author;
?>
<div id="authorbox" class="clear fl">
<?php if (function_exists('get_avatar')) { echo get_avatar( get_the_author_meta('email', $author), '80' ); }?>
<div class="authortext">
<header>
<h4><?php _e('About', "presswork"); ?> <?php if(is_author()) the_author_meta('display_name', $author); else the_author_posts_link(); ?></h4>
</header>
<p><?php the_author_meta('description', $author); ?></p>
<p><a href="<?php the_author_meta('url', $author); ?>"><?php the_author_meta('url', $author); ?></a></p>
</div>
</div>
<?php
}
add_action('pw_single_bottom', 'pw_authorbox');
/*
* Columns top
*/
function pw_columns_post_title($r) {
if(function_exists('has_post_format') && (has_post_format('aside') || has_post_format('link'))) { // new aside || link post format
// do nothing
} else {
?>
<header>
<hgroup>
<h1 class="posttitle"><a href="<?php the_permalink() ?>" title="<?php printf(__("Permanent Link to %s", "presswork"), the_title_attribute('echo=0')); ?>"><?php the_title(); ?></a></h1>
<h2 class="meta">
<?php
if(isset($r['authors'])) { _e("by", "presswork"); echo " "; the_author_posts_link(); }
if(isset($r['dates'])) { echo ' • '; the_time(get_option('date_format')); }
if(isset($r['comments']) && comments_open()) { echo ' • '; comments_popup_link(__('0 Comments', "presswork"),__('1 Comment', "presswork"),__('% Comments', "presswork")); }
?>
</h2>
</hgroup>
</header>
<?php
}
}
add_action('pw_columns_top', 'pw_columns_post_title', 1, 1);
function pw_columns_post_content($r) {
?>
<div class="storycontent">
<?php
if(function_exists('has_post_format') &&
(has_post_format('aside') || has_post_format('link') || has_post_format('video') || has_post_format('image') || has_post_format('audio'))) {
// new aside || link || audio || video || image post format
echo '<div class="pformat clear">';
the_content('');
echo '</div>';
} elseif(function_exists('has_post_format') && has_post_format('gallery')) { // new gallery post format
global $post;
$images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
if ( $images ) :
$total_images = count( $images );
$image = array_shift( $images );
$image_img_tag = wp_get_attachment_image( $image->ID, 'full' );
?>
<a class="gallery-thumb" href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a>
<p class="gallery-text clear fl"><em><?php printf( _n( 'This gallery contains <a %1$s>%2$s photo →</a>', 'This gallery contains <a %1$s>%2$s photos →</a>', $total_images, "presswork" ),
'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', "presswork" ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',
number_format_i18n( $total_images )
); ?></em>
</p>
<?php endif; ?>
<?php
} else {
if($r['text']=="content") {
if($r['readmore']==1) {
the_content(__( 'Read more →', "presswork" ));
} else {
the_content('');
}
} else {
if($r['images']==1) {
if(function_exists('has_post_thumbnail') && has_post_thumbnail()) {
echo '<a href="'.get_permalink().'">';
the_post_thumbnail(array($r['img_w'], $r['img_h']), array('class'=>$r['img_float']));
echo '</a>';
}
}
the_excerpt();
if($r['readmore']==1) echo '<a href="'.get_permalink().'" class="more-link">'.__( 'Read more →', "presswork" ).'</a>';
}
}
?>
</div>
<?php
}
add_action('pw_columns_middle', 'pw_columns_post_content', 1, 1);
// Including child theme action file
if(!defined('CHILD_ACTION_FILE'))
define('CHILD_ACTION_FILE', STYLESHEETPATH.'/actions.php');
if(file_exists(CHILD_ACTION_FILE))
include(CHILD_ACTION_FILE);
?>