File: /home/fliyingp/domains/fliyingpigeon.hk/public_html/wp-content/themes/ocean-theme/single.php
<?php
function enqueue_posts_files() {
wp_enqueue_style('post-style', get_template_directory_uri() . '/post.css', array(), null, 'all');
wp_enqueue_style('case-style', get_template_directory_uri() . '/case.css', array(), null, 'all');
wp_enqueue_style('top-title-style', get_template_directory_uri() . '/template-parts/blocks/top-title/style.css', array(), null, 'all');
wp_enqueue_style('news-style', get_template_directory_uri() . '/template-parts/blocks/news/style.css', array(), null, 'all');
};
add_action('wp_enqueue_scripts', 'enqueue_posts_files');
?>
<?php get_header(); ?>
<section class='breadcrumbs-section'>
<div class='container'>
<div class='breadcrumbs-section__content'>
<div class='ocean-breadcrumbs'>
<a class='ocean-breadcrumbs__link' href="#" data-go-back>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.69594 12.0396L2.65234 7.99995L6.70706 3.94922L7.55778 4.79475L4.96151 7.39367H13.3606V8.60067H4.96151L7.54666 11.1858L6.69594 12.0396Z" fill="white"/>
</svg>
</a>
<div class='ocean-breadcrumbs__list'>
<a href='/'>
головна
</a>
<span class="separator">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.13392 12.0394L10.1847 7.98871L6.13392 3.93799L5.2832 4.79982L8.47209 7.98871L5.2832 11.1776L6.13392 12.0394Z" fill="#F0F2F5"/>
</svg>
</span>
<a href='/blog/'>
блог
</a>
<span class="separator current">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.13392 12.0394L10.1847 7.98871L6.13392 3.93799L5.2832 4.79982L8.47209 7.98871L5.2832 11.1776L6.13392 12.0394Z" fill="#F0F2F5"/>
</svg>
</span>
<span class="current">
<?php the_title(); ?>
</span>
</div>
</div>
</div>
</div>
</section>
<section class='top-title'>
<div class='container'>
<div class='top-title__content'>
<div class='top-title__left'>
<div class='top-title__mini-title mini-title'>
<div class='circle'></div>
<h2><?php echo get_the_date('F j, Y'); ?></h2>
</div>
</div>
<div class='top-title__right'>
<div class='top-title__main-text anim-title'>
<?php echo the_title(); ?>
</div>
</div>
</div>
</div>
</section>
<section class='post-content'>
<div class='container'>
<div class='post-content__inner'>
<?php if (has_post_thumbnail()) : ?>
<div class='post-content__thumbnail'>
<?php the_post_thumbnail('full'); ?>
</div>
<?php endif; ?>
<?php
if (have_posts()) :
while (have_posts()) : the_post();
the_content();
endwhile;
endif;
?>
</div>
<?php
$current_id = get_the_ID();
$prev_post = get_previous_post();
$next_post = get_next_post();
?>
<div class='project-gallery__footer'>
<?php if ($prev_post): ?>
<a class='project-gallery__prev-proj' href="<?php echo get_permalink($prev_post); ?>">
<img src="<?php echo get_the_post_thumbnail_url($prev_post, 'full'); ?>" alt="<?php echo esc_attr(get_the_title($prev_post)); ?>">
<div class='project-gallery__prev-proj-container'>
<svg width="24" height="25" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2.53914 13.7545L2.45594 13.8371C1.65153 14.6796 1.63967 16.0067 2.42899 16.8635L2.51043 16.9473L7.26356 21.5967L8.52215 20.31L4.34559 16.2242H18.6272C20.5756 16.2241 22.1551 14.6447 22.1552 12.6963V6.93125C22.155 4.98289 20.5756 3.40347 18.6272 3.40332H14.7477V5.20332H18.6272C19.5815 5.20347 20.355 5.97701 20.3552 6.93125V12.6963C20.3551 13.6506 19.5815 14.4241 18.6272 14.4242H4.45223L8.51102 10.5939L7.27528 9.28496L2.53914 13.7545Z" fill="#F0F2F5"/>
</svg>
<p>Попередній проект</p>
</div>
</a>
<?php endif; ?>
<?php if ($next_post): ?>
<a class='project-gallery__next-proj' href="<?php echo get_permalink($next_post); ?>">
<img src="<?php echo get_the_post_thumbnail_url($next_post, 'full'); ?>" alt="<?php echo esc_attr(get_the_title($next_post)); ?>">
<div class='project-gallery__next-proj-container'>
<div class='project-gallery__next-proj-top'>
<p>Наступна новина</p>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M21.4607 13.2545L21.5439 13.3371C22.3484 14.1796 22.3602 15.5067 21.5709 16.3635L21.4895 16.4473L16.7363 21.0967L15.4777 19.81L19.6543 15.7242H5.37266C3.42426 15.7241 1.84481 14.1447 1.84473 12.1963V6.43125C1.84487 4.48289 3.4243 2.90347 5.37266 2.90332H9.25215V4.70332H5.37266C4.41841 4.70347 3.64487 5.47701 3.64473 6.43125V12.1963C3.64481 13.1506 4.41838 13.9241 5.37266 13.9242H19.5477L15.4889 10.0939L16.7246 8.78496L21.4607 13.2545Z" fill="#F0F2F5"/>
</svg>
</div>
<div class='project-gallery__next-proj-bot'>
[ <?php echo get_the_title($next_post); ?> ]
</div>
</div>
</a>
<?php endif; ?>
</div>
</div>
</section>
<?php
$args = [
'post_type' => 'post',
'posts_per_page' => 3
];
$query = new WP_Query($args);
?>
<section class='news'>
<div class='container'>
<div class='news__content'>
<div class='news__head'>
<div class='news__mini-title mini-title'>
<div class='circle'></div>
<h2>новини</h2>
</div>
<div class='news__title anim-title'>
<p>
інші <strong>новини</strong>
</p>
</div>
</div>
<div class='news__body'>
<?php if ($query->have_posts()) : $query->the_post(); ?>
<div class='news__big news__item'>
<?php if (has_post_thumbnail()) : ?>
<img src='<?php the_post_thumbnail_url('large'); ?>' alt='<?php the_title(); ?>'>
<?php endif; ?>
<p class='news__date'><?php echo get_the_date(); ?></p>
<p class='news__tilte'><?php the_title(); ?></p>
<a class='news__button' href='<?php the_permalink(); ?>'>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.3078 8.83633L14.3633 8.89141C14.8996 9.4531 14.9075 10.3378 14.3812 10.909L14.327 10.9648L11.1582 14.0645L10.3191 13.2066L13.1035 10.4828H3.58242C2.28349 10.4827 1.23053 9.4298 1.23047 8.13086V4.2875C1.23057 2.9886 2.28352 1.93564 3.58242 1.93555H6.16875V3.13555H3.58242C2.94626 3.13564 2.43057 3.65134 2.43047 4.2875V8.13086C2.43053 8.76706 2.94623 9.28271 3.58242 9.28281H13.0324L10.3266 6.7293L11.1504 5.85664L14.3078 8.83633Z" fill="#001C36"/>
</svg>
</a>
</div>
<?php endif; ?>
<div class='news__small-list'>
<?php while ($query->have_posts()) : $query->the_post(); ?>
<div class='news__small-item news__item'>
<?php if (has_post_thumbnail()) : ?>
<img src='<?php the_post_thumbnail_url('medium'); ?>' alt='<?php the_title(); ?>'>
<?php endif; ?>
<p class='news__date'><?php echo get_the_date(); ?></p>
<p class='news__tilte'><?php the_title(); ?></p>
<a class='news__button' href='<?php the_permalink(); ?>'>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.3078 8.83633L14.3633 8.89141C14.8996 9.4531 14.9075 10.3378 14.3812 10.909L14.327 10.9648L11.1582 14.0645L10.3191 13.2066L13.1035 10.4828H3.58242C2.28349 10.4827 1.23053 9.4298 1.23047 8.13086V4.2875C1.23057 2.9886 2.28352 1.93564 3.58242 1.93555H6.16875V3.13555H3.58242C2.94626 3.13564 2.43057 3.65134 2.43047 4.2875V8.13086C2.43053 8.76706 2.94623 9.28271 3.58242 9.28281H13.0324L10.3266 6.7293L11.1504 5.85664L14.3078 8.83633Z" fill="#001C36"/>
</svg>
</a>
</div>
<?php endwhile; ?>
</div>
<?php wp_reset_postdata(); ?>
</div>
</div>
</div>
</section>
<?php get_footer(); ?>