-
Notifications
You must be signed in to change notification settings - Fork 0
/
single.php
105 lines (103 loc) · 5.01 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
<?php
/**
* The template for displaying all single posts.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
*
* @package Ribbon Lite
*/
$ribbon_lite_single_breadcrumb_section = get_theme_mod('ribbon_lite_single_breadcrumb_section', '1');
$ribbon_lite_single_tags_section = get_theme_mod('ribbon_lite_single_tags_section', '1');
$ribbon_lite_authorbox_section = get_theme_mod('ribbon_lite_authorbox_section', '1');
$ribbon_lite_relatedposts_section = get_theme_mod('ribbon_lite_relatedposts_section', '1');
get_header(); ?>
<div id="page" class="single">
<div class="content">
<!-- Start Article -->
<article class="article">
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class('post'); ?>>
<div class="single_post">
<?php if($ribbon_lite_single_breadcrumb_section == '1') { ?>
<div class="breadcrumb" xmlns:v="http://rdf.data-vocabulary.org/#"><?php ribbon_lite_the_breadcrumb(); ?></div>
<?php } ?>
<header>
<!-- Start Title -->
<h1 class="title single-title"><?php the_title(); ?></h1>
<!-- End Title -->
</header>
<!-- Start Content -->
<div id="content" class="post-single-content box mark-links">
<?php the_content(); ?>
<?php wp_link_pages(array('before' => '<div class="pagination">', 'after' => '</div>', 'link_before' => '<span class="current"><span class="currenttext">', 'link_after' => '</span></span>', 'next_or_number' => 'next_and_number', 'nextpagelink' => __('Next', 'ribbon-lite' ), 'previouspagelink' => __('Previous', 'ribbon-lite' ), 'pagelink' => '%','echo' => 1 )); ?>
<?php if($ribbon_lite_single_tags_section == '1') { ?>
<!-- Start Tags -->
<div class="tags"><?php the_tags('<span class="tagtext">'.__('Tags','ribbon-lite').':</span>',', ') ?></div>
<!-- End Tags -->
<?php } ?>
</div><!-- End Content -->
<?php if($ribbon_lite_relatedposts_section == '1') { ?>
<!-- Start Related Posts -->
<?php $categories = get_the_category($post->ID);
if ($categories) { $category_ids = array();
foreach($categories as $individual_category)
$category_ids[] = $individual_category->term_id;
$args=array( 'category__in' => $category_ids,
'post__not_in' => array($post->ID),
'ignore_sticky_posts' => 1,
'showposts'=> 3,
'orderby' => 'rand' );
$my_query = new wp_query( $args ); if( $my_query->have_posts() ) {
echo '<div class="related-posts"><div class="postauthor-top"><h3>'.__('Related Posts', 'ribbon-lite').'</h3></div>';
$pexcerpt=1; $j = 0; $counter = 0;
while( $my_query->have_posts() ) {
$my_query->the_post();?>
<article class="post excerpt <?php echo (++$j % 3== 0) ? 'last' : ''; ?>">
<?php if ( has_post_thumbnail() ) { ?>
<a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>" id="featured-thumbnail">
<div class="featured-thumbnail">
<?php the_post_thumbnail('ribbon-lite-related',array('title' => '')); ?>
<?php if (function_exists('wp_review_show_total')) wp_review_show_total(true, 'latestPost-review-wrapper'); ?>
</div>
<header>
<h4 class="title front-view-title"><?php the_title(); ?></h4>
</header>
</a>
<?php } else { ?>
<a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>" id="featured-thumbnail">
<div class="featured-thumbnail">
<img src="<?php echo get_template_directory_uri(); ?>/images/nothumb-related.png" class="attachment-featured wp-post-image" alt="<?php the_title_attribute(); ?>">
<?php if (function_exists('wp_review_show_total')) wp_review_show_total(true, 'latestPost-review-wrapper'); ?>
</div>
<header>
<h4 class="title front-view-title"><?php the_title(); ?></h4>
</header>
</a>
<?php } ?>
</article><!--.post.excerpt-->
<?php $pexcerpt++;?>
<?php } echo '</div>'; }} wp_reset_postdata(); ?>
<!-- End Related Posts -->
<?php }?>
<?php if($ribbon_lite_authorbox_section == '1') { ?>
<!-- Start Author Box -->
<div class="postauthor">
<h4><?php _e('About Author', 'ribbon-lite'); ?></h4>
<?php if(function_exists('get_avatar')) { echo get_avatar( get_the_author_meta('email'), '85' ); } ?>
<h5><?php the_author_meta( 'nickname' ); ?></h5>
<p><?php the_author_meta('description') ?></p>
</div>
<!-- End Author Box -->
<?php }?>
<?php comments_template( '', true ); ?>
</div>
</div>
<?php endwhile; ?>
</article>
<!-- End Article -->
<!-- Start Sidebar -->
<?php get_sidebar(); ?>
<!-- End Sidebar -->
</div>
</div>
<?php get_footer(); ?>