-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathsingle.php
124 lines (109 loc) · 4.25 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
<?php get_header(); ?>
<!-- [ #container ] -->
<div id="container" class="innerBox">
<!-- [ #content ] -->
<div id="content" class="content">
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<!-- [ #post- ] -->
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if (is_biz_vektor_extra_single()) : ?>
<?php biz_vektor_extra_single(); ?>
<?php else: ?>
<h1 class="entryPostTitle entry-title"><?php the_title(); ?><?php edit_post_link(__('Edit', 'biz-vektor'), ' <span class="edit-link edit-item">[ ', ' ]' ); ?></h1>
<?php get_template_part('module_entry_meta');?>
<div class="entry-content post-content">
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . 'Pages:', 'after' => '</div>' ) ); ?>
<div class="entry-utility">
<?php
$tags_list = get_the_tag_list( '', ', ' );
if ( $tags_list ):
?>
<dl class="tag-links">
<?php printf( __('<dt>Tags</dt><dd>%1$s</dd>', 'biz-vektor'), $tags_list ); ?>
</dl>
<?php endif; ?>
</div>
<!-- .entry-utility -->
</div><!-- .entry-content -->
<?php edit_post_link(__('Edit', 'biz-vektor'),'<div class="adminEdit"><span class="linkBtn linkBtnS linkBtnAdmin">','</span></div>'); ?>
<?php do_action('biz_vektor_snsBtns'); ?>
<?php
/*-------------------------------------------*/
/* Related posts
/*-------------------------------------------*/
if ( get_post_type() == 'post' ) :
$biz_vektor_options = biz_vektor_get_theme_options();
// Get now post's tag(terms)
if (isset($biz_vektor_options['postRelatedCount']) && $biz_vektor_options['postRelatedCount'] ) {
$terms = get_the_terms($post->ID,'post_tag');
if ($terms) {
$tag_count = count($terms);
$posts_count = mb_convert_kana($biz_vektor_options['postRelatedCount'], "a", "UTF-8");
// Set basic arrays
$args = array( 'post_type' => 'post' ,'post__not_in' => array($post->ID), 'posts_per_page' => $posts_count );
// Set tag(term) arrays
if ( $terms && $tag_count == 1 ) {
foreach ( $terms as $key => $value) {
$args['tag_id'] = $value->term_id ;
}
} else if ( $terms ) {
foreach ( $terms as $key => $value) {
$args['tag__in'][] = $value->term_id ;
}
}
$tag_posts = get_posts($args);
if ( $tag_posts ) { ?>
<!-- [ .subPostListSection ] -->
<div class="subPostListSection">
<h3>関連記事</h3>
<ul class="child_outer">
<?php foreach ($tag_posts as $key => $post) { ?>
<li class="ttBox">
<div class="entryTxtBox<?php if ( has_post_thumbnail()) echo ' ttBoxTxt ttBoxRight haveThumbnail'; ?>">
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</div><!-- [ /.entryTxtBox ] -->
<?php if ( has_post_thumbnail()) { ?>
<div class="ttBoxThumb ttBoxLeft"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a></div>
<?php } ?>
</li>
<?php } // foreach ?>
</ul><!-- [ /.child_outer ] -->
</div><!-- [ /.subPostListSection ] -->
<?php } // if ( $tag_posts )
} // if ( $terms )
} // if ( $biz_vektor_options['postRelatedCount'] ) {
endif;
wp_reset_postdata();
/*-------------------------------------------*/
/* ad_related_after
/*-------------------------------------------*/
if ( get_post_type() == 'post' ) :
$biz_vektor_options = biz_vektor_get_theme_options();
if (isset($biz_vektor_options['ad_related_after']) && $biz_vektor_options['ad_related_after']) {
echo '<div class="sectionBox">'.apply_filters('widget_text',$biz_vektor_options['ad_related_after']).'</div>';
}
endif;
?>
<div id="nav-below" class="navigation">
<div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">←</span> %title' ); ?></div>
<div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">→</span>' ); ?></div>
</div><!-- #nav-below -->
<?php endif; ?>
</div>
<!-- [ /#post- ] -->
<?php do_action('biz_vektor_fbComments'); ?>
<?php comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>
<?php do_action('biz_vektor_fbLikeBoxDisplay'); ?>
</div>
<!-- [ /#content ] -->
<!-- [ #sideTower ] -->
<div id="sideTower" class="sideTower">
<?php get_sidebar(get_post_type()); ?>
</div>
<!-- [ /#sideTower ] -->
<?php biz_vektor_sideTower_after();?>
</div>
<!-- [ /#container ] -->
<?php get_footer(); ?>