-
Notifications
You must be signed in to change notification settings - Fork 4
/
content-post.php
76 lines (72 loc) · 2.6 KB
/
content-post.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
<?php
global $theme, $more;
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if (!is_single() || is_search()): ?>
<h2>
<a href="<?php the_permalink(); ?>" title="<?php printf(esc_attr__('Permalink to %s', 'rockharbor'), the_title_attribute('echo=0')); ?>" rel="bookmark"><?php the_title(); ?></a>
<?php
$theme->set('pubdate', true);
$theme->set('date', $post->post_date);
echo $theme->render('posted_date');
?>
</h2>
<?php endif; ?>
<div class="entry-content clearfix">
<?php
if (!$more) {
$attachId = get_post_thumbnail_id($id);
if (!empty($attachId)) {
$title = get_the_title();
$imageUrl = call_user_func("wp_get_attachment_thumb_url", $attachId);
echo "<img src=\"$imageUrl\" alt=\"$title\" class=\"every-other-float\" />";
}
}
?>
<?php if ( is_category() || is_archive() || is_home() ) {
the_excerpt();
} else {
the_content(__('Read More', 'rockharbor'));
} ?>
<?php echo $theme->render('pagination_posts'); ?>
</div>
<div class="entry-footer">
<?php
/**
* WordPress doesn't correctly/fully switch from blog to blog, so things
* like permalinking to categories will use the current blog's permalinks
* rather than the switched blog's. Instead, we'll show the blog it
* came from if this isn't the home blog.
*
* @see http://core.trac.wordpress.org/ticket/12040
*/
if (isset($post->blog_id) && $post->blog_id != $theme->info('id')):
$blogDetails = get_site($post->blog_id);
?>
<span class="tags">Posted from <a href="<?php echo $blogDetails->__get('siteurl'); ?>"><?php echo $blogDetails->__get('blogname'); ?></a>
<?php else: ?>
<span class="tags">Posted in <?php the_category(', ') . the_tags(' | ', ', '); ?>
<?php endif; ?>
</span>
<?php if (!is_single() || is_search()): ?>
<span class="comments-link"> | <?php comments_popup_link('<span class="leave-reply">' . __('Leave a reply', 'rockharbor') . '</span>', __('<b>1</b> Reply', 'rockharbor'), __('<b>%</b> Replies', 'rockharbor')) ?></span>
<?php endif; ?>
</div>
<?php
if ($more) {
$theme->set('types', array('post', 'page'));
$related = $theme->render('related_content');
$comments = '';
if (comments_open()) {
// have to capture because wordpress just auto-echoes everything
ob_start();
comments_template('', true);
$comments = ob_get_clean();
$comments = trim(preg_replace('/\s+/', ' ', $comments));
}
if (!empty($related) || !empty($comments)) {
echo $theme->Html->tag('div', $related.$comments, array('class' => 'related clearfix'));
}
}
?>
</article>