ldc-groupe/content/themes/ldc/single.php
2020-08-21 14:55:47 +02:00

73 lines
3.3 KiB
PHP

<?php get_header(); ?>
<?php
global $tp;
global $chirkashi;
$author = get_field('author');
$text_blocks = get_field('text_blocks');
$tags = get_the_tags($post->ID);
?>
<div class="single-news fw">
<div class="single-news__wrapper wrapper">
<div class="textblock fw fw-container">
<?php get_template_part('partials/breadcrumbs'); ?>
<div class="textblock__wrapper wrapper">
<?php if(!empty($tags)) : ?>
<div class="single-news__tags tags">
<div class="single-news__tag tag tag_<?php echo $tags[0]->slug; ?>">
<?php foreach ($tags as $k => $tag): ?>
<?php if ($k !== 0): ?>, <?php endif; ?><?= $tag->name; ?>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
<h1 class="single-news__title subtitle"><?php the_title(); ?></h1>
<div class="single-news__date date date_<?php echo $tags[0]->slug; ?>"><?= get_field('date', $post->ID); ?></div>
<?php if(!empty($author)) : ?>
<div class="single-news__author"><?php echo $author; ?></div>
<?php endif; ?>
<?php if(!empty($text_blocks)) : ?>
<?php foreach($text_blocks as $l) : ?>
<div class="textblock__container <?php if($l['swap_position'] == 1) : ?>textblock__container_swap <?php endif; ?>">
<?php if(!empty($l['image'])) : ?>
<div class="textblock__image textblock__block image-border-wrap">
<?php
$borders = $l['image_borders'];
set_query_var('borders', $borders);
get_template_part('partials/borders');
?>
<img src="<?php echo $l['image']; ?>" alt="<?php echo (!empty($l['title']) ? $l['title'] : ' '); ?>" />
</div>
<?php endif; ?>
<div class="textblock__info textblock__block">
<?php if(!empty($l['title'])) : ?>
<div class="textblock__info-title subtitle"><?php echo $l['title']; ?></div>
<?php endif; ?>
<?php if(!empty($l['text'])) : ?>
<div class="textblock__info-description description"><?php echo $l['text']; ?></div>
<?php endif; ?>
</div>
<?php if(!empty($l['button']['url'])) : ?>
<a class="textblock__info-btn btn" href="<?php echo $l['button']['url']; ?>" title="<?php echo $l['button']['title']; ?>"><?php echo $l['button']['title']; ?> <i class="btn__icon btn__icon_arrow-right"></i></a>
<?php endif; ?>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>