-
Notifications
You must be signed in to change notification settings - Fork 34
/
content.php
168 lines (139 loc) · 4.46 KB
/
content.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
<?php
/**
* The default template for displaying content
*
* Used for both single and index/archive/search.
*
* @package WordPress
* @subpackage JBST
* @since jbst 2.0
*/
?>
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?>>
<header class="entry-header">
<?php $ontitle = the_title_attribute( array('echo' => 0 ) );
$ontitlestr = '<span class="sr-only">%s'.esc_attr( str_replace('%','',$ontitle )).'</span>';
echo '<h1 class="entry-title">';
if ( is_single() ) :
the_title();
else :
the_title( '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a>' );
endif;
echo '</h1>';
?>
<?php
if (!is_search())
{
?>
<div class="entry-meta"><p>
<?php
if ( 'post' == get_post_type() )
jbst_posted_on();
?>
</p></div><!-- .entry-meta -->
<?php
}
?>
</header><!-- .entry-header -->
<?php if ( is_search() ) : ?>
<div class="entry-summary">
<?php (get_theme_mod('jbst_post_display_search','excerpt')==='excerpt')?the_excerpt():the_content();
?>
<?php
echo '<a class="read-more" href="'. get_permalink( get_the_ID() ) . '">'. get_permalink( get_the_ID() ) . '</a>';
?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
the_post_thumbnail('thumbnail',array('class'=>'img-responsive img-content-class'));
}
?>
<?php
if((is_home() && get_theme_mod('jbst_post_display_main','excerpt')==='excerpt')
|| (is_category() && get_theme_mod('jbst_post_display_category','excerpt')==='excerpt')
|| (is_tag() && get_theme_mod('jbst_post_display_tag','excerpt')==='excerpt')
|| (is_tax() && get_theme_mod('jbst_post_display_taxonomy','excerpt')==='excerpt')
// || is_search())
)
{
the_excerpt();
}
else
{
the_content();
}
wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'jamedo-bootstrap-start-theme' ), 'after' => '</div>' ) );
?>
</div><!-- .entry-content -->
<?php endif; ?>
<?php
if(!is_search())
{
$sep = '';
?>
<footer class="entry-meta no-border">
<?php
if ( 'post' == get_post_type() )
{
$ispost = true;
$categories_list = get_the_category_list(', ');
if ( $categories_list && jbst_categorized_blog() ) :
?>
<span class="cat-links">
<?php printf( __( 'Posted in %1$s', 'jamedo-bootstrap-start-theme' ), $categories_list ); ?>
</span>
<?php endif; // End if categories ?>
<?php
$tags_list = get_the_tag_list( '', ', ' );
if ( $tags_list ) :
if($categories_list){
?><span class="sep"> | </span><?php
}
?>
<span class="tag-links">
<?php printf( __( 'Tagged %1$s', 'jamedo-bootstrap-start-theme' ), $tags_list ); ?>
</span>
<?php endif; // End if $tags_list ?>
<?php if($categories_list || $tags_list){
$sep = '<span class="sep"> | </span>';
}
}//End if 'post' == get_post_type()
else
{
$sep = '<span class="sep"> | </span>';
$ispost = false;
}?>
<?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?>
<?php
if(!get_theme_mod('page_comments', 0))
{
if($ispost)echo $sep;
?>
<span class="comments-link"><?php
jbst_comments_popup_link(
sprintf(__( 'Leave a comment %s', 'jamedo-bootstrap-start-theme' ),sprintf($ontitlestr,' on ')),
sprintf(__( '1 Comment %s', 'jamedo-bootstrap-start-theme' ),sprintf($ontitlestr,' on ')),
'% '.sprintf(__( 'Comments %s', 'jamedo-bootstrap-start-theme' ),sprintf($ontitlestr,' on ')) ); ?>
</span>
<?php
}
?>
<?php endif; ?>
<?php edit_post_link( __( 'Edit', 'jamedo-bootstrap-start-theme' ) . sprintf($ontitlestr,': ') , $sep.'<span class="edit-link">', '</span>' ); ?>
</footer><!-- #entry-meta -->
<?php
}
?>
</article><!-- #post-## -->
<?php endwhile; ?>
<?php
if(is_single() && !get_theme_mod('page_comments', 0)) {
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || '0' != get_comments_number() )
{
comments_template();
}
}
?>