Single Post

This commit is contained in:
Roman Pyrih
2025-08-29 15:55:29 +02:00
parent 43c2862974
commit 0be0da088b
6 changed files with 669 additions and 63 deletions

View File

@@ -10,28 +10,75 @@
get_header();
?>
<main id="primary" class="site-main">
<main id="primary" class="site-main page-single-post">
<div class="box-1">
<div class="container">
<?php
while ( have_posts() ) :
the_post();
get_template_part( 'template-parts/content', get_post_type() );
if (true == false) {
the_post_navigation(
array(
'prev_text' => '<span class="nav-subtitle">' . esc_html__( 'Previous:', 'brpp-prawo-podatki' ) . '</span> <span class="nav-title">%title</span>',
'next_text' => '<span class="nav-subtitle">' . esc_html__( 'Next:', 'brpp-prawo-podatki' ) . '</span> <span class="nav-title">%title</span>',
)
);
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
}
endwhile; // End of the loop.
?>
</div>
</div>
<?php
while ( have_posts() ) :
the_post();
get_template_part( 'template-parts/content', get_post_type() );
the_post_navigation(
array(
'prev_text' => '<span class="nav-subtitle">' . esc_html__( 'Previous:', 'brpp-prawo-podatki' ) . '</span> <span class="nav-title">%title</span>',
'next_text' => '<span class="nav-subtitle">' . esc_html__( 'Next:', 'brpp-prawo-podatki' ) . '</span> <span class="nav-title">%title</span>',
)
$args = array(
'post_type' => 'post',
'posts_per_page' => 3,
'orderby' => 'date',
'order' => 'DESC',
'post__not_in' => array(get_the_ID()),
);
$other_posts = new WP_Query($args);
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
endwhile; // End of the loop.
if ($other_posts->have_posts()) :
?>
<div class="box-2">
<div class="container">
<div class="row" box-title="Blog">
<div class="box-head">
<h2>Zobacz też inne wpisy</h2>
<div class="other-posts">
<?php
while ($other_posts->have_posts()) : $other_posts->the_post();
$image = get_the_post_thumbnail_url(get_the_ID(), 'medium');
$title = get_the_title();
$link = get_permalink();
get_template_part(
'inc/template-article-card', null, [
'image' => $image,
'title' => $title,
'link' => $link
]
);
endwhile;
wp_reset_postdata();
?>
</div>
</div>
</div>
</div>
</div>
<?php endif; ?>
</main><!-- #main -->
<?php