121 lines
3.3 KiB
PHP
121 lines
3.3 KiB
PHP
<?php
|
|
/**
|
|
* The template for displaying all single posts
|
|
*
|
|
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
|
|
*
|
|
* @package Yuzu
|
|
*/
|
|
|
|
get_header();
|
|
?>
|
|
|
|
<div id="primary" class="content-area">
|
|
<main id="main" class="site-main">
|
|
|
|
<div <?php post_class("single-article top-and-bottom-margin"); ?>>
|
|
<?php
|
|
while ( have_posts() ) :
|
|
the_post();
|
|
?>
|
|
<div class="article-header medium-container">
|
|
<div class="article-categories">
|
|
<?php
|
|
$post_categories = wp_get_post_categories( get_the_ID() );
|
|
foreach($post_categories as $c){
|
|
$cat = get_category( $c );
|
|
?>
|
|
<a href="<?= get_term_link($c); ?>" class="article-category">
|
|
<?= $cat->name; ?>
|
|
</a>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
<h1 class="article-title"><?= get_the_title(); ?></h1>
|
|
<?php if(get_theme_mod('display_posts_meta', true)) { ?>
|
|
<div class="article-meta">
|
|
<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" class="author-picture" style="background-image: url(<?= get_avatar_url(get_the_author_meta('ID')) ?>"></a>
|
|
<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_author(); ?></a>
|
|
|
|
|
<?= get_the_date(); ?>
|
|
</div>
|
|
<?php } ?>
|
|
</div>
|
|
|
|
<?php
|
|
$featured_image = get_the_post_thumbnail_url(get_the_ID(),'large');
|
|
if($featured_image) { ?>
|
|
<div class="article-featured-image fullwidth-container">
|
|
<img src="<?= $featured_image; ?>">
|
|
</div>
|
|
<?php
|
|
}
|
|
?>
|
|
|
|
<div class="entry-content fullwidth-container">
|
|
<?php
|
|
the_content();
|
|
wp_link_pages();
|
|
?>
|
|
</div>
|
|
|
|
<?php if(get_theme_mod('display_posts_navigation', true)) { ?>
|
|
<div class="related-posts">
|
|
<?php
|
|
$prev_post = get_previous_post();
|
|
if (!empty( $prev_post )){ ?>
|
|
<a href="<?= get_permalink($prev_post->ID); ?>" class="previous-post">
|
|
<div class="background"
|
|
style="background-image: url(<?= get_the_post_thumbnail_url($prev_post->ID,'large'); ?>"></div>
|
|
<div class="filter"></div>
|
|
<div class="content">
|
|
<div class="label">
|
|
<?php _e('Previous Post', 'yuzu'); ?>
|
|
</div>
|
|
<h3 class="post-title"><?= $prev_post->post_title; ?></h3>
|
|
</div>
|
|
</a>
|
|
<?php
|
|
}
|
|
$next_post = get_next_post();
|
|
if (!empty( $next_post )){ ?>
|
|
<a href="<?= get_permalink($next_post->ID); ?>" class="next-post">
|
|
<div class="background"
|
|
style="background-image: url(<?= get_the_post_thumbnail_url($next_post->ID,'large'); ?>"></div>
|
|
<div class="filter"></div>
|
|
<div class="content">
|
|
<div class="label">
|
|
<?php _e('Next Post', 'yuzu'); ?>
|
|
</div>
|
|
<h3 class="post-title"><?= $next_post->post_title; ?></h3>
|
|
</div>
|
|
</a>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php
|
|
// If comments are open or we have at least one comment, load up the comment template.
|
|
if ( comments_open() || get_comments_number() ) :
|
|
?>
|
|
<div class="comments-section">
|
|
<?php
|
|
comments_template();
|
|
?>
|
|
</div>
|
|
<?php
|
|
endif;
|
|
|
|
endwhile; // End of the loop.
|
|
?>
|
|
</div>
|
|
|
|
</main><!-- #main -->
|
|
</div><!-- #primary -->
|
|
|
|
<?php
|
|
get_footer();
|