1er commit

This commit is contained in:
2020-04-21 13:42:20 +02:00
commit d94c985d0e
8 changed files with 452 additions and 0 deletions

143
single.php Normal file
View File

@@ -0,0 +1,143 @@
<?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 } ?>
<?php //printLikes(get_the_ID()); ?>
</div>
<?php
# Image à la une
$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();
?>
<?php if(has_tag()) : ?>
<div class="post-tags">
<!--h4><?php //esc_html_e( 'Tags:', 'yuzu-child' ); ?></h4-->
<?php the_tags('',''); ?>
</div>
<?php endif; ?>
</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 } ?>
<div class="clear"></div>
<?php if ( comments_open() || '0' != get_comments_number() ) : ?>
<div class="home_blog_box">
<button id="togle">
<?php
_e('Display','yuzu-child');
comments_number(esc_html__(' 0 comment','yuzu-child'), esc_html__(' 1 comment','yuzu-child'), '% '.esc_html__(' comments','yuzu-child') );
?>
</button>
<!--div class="comments_cont"-->
<div class="comments-section">
<?php
// If comments are open or we have at least one comment, load up the comment template
comments_template( '', true );
?>
</div>
</div>
<?php endif;
endwhile; // End of the loop.
?>
</div>
</main><!-- #main -->
</div><!-- #primary -->
<?php
get_footer();