FEATURE Handling the default single page

This commit is contained in:
Antoine M 2026-02-24 15:02:52 +01:00
parent f3ea7af3e3
commit cea500ceda

View File

@ -1,40 +1,39 @@
<?php get_header(); ?>
<div class="container my-8 mx-auto">
<?php
$postType = get_post_type();
?>
<div class="page-single page--single-<?php echo $postType; ?>" data-article-id="<?php echo get_the_ID(); ?>">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php get_template_part('template-parts/components/posts/post-header'); ?>
<?php
while (have_posts()) :
the_post();
?>
<?php get_template_part('template-parts/components/posts/post-toolbar'); ?>
<div class="content-wrapper" data-active-tab="post">
<aside class="sidebar">
<?php get_template_part('template-parts/components/posts/post-tags'); ?>
</aside>
<div class="content-area">
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php get_template_part('template-parts/components/posts/post-content', null, array(
'ID' => get_the_ID()
)); ?>
<header class="entry-header mb-4">
<?php the_title(sprintf('<h1 class="entry-title text-2xl lg:text-5xl font-extrabold leading-tight mb-1"><a href="%s" rel="bookmark">', esc_url(get_permalink())), '</a></h1>'); ?>
<time datetime="<?php echo get_the_date('c'); ?>" itemprop="datePublished" class="text-sm text-gray-700"><?php echo get_the_date(); ?></time>
</header>
<div class="entry-content">
<?php the_content(); ?>
<?php
wp_link_pages(
array(
'before' => '<div class="page-links"><span class="page-links-title">' . __('Pages:', 'tailpress') . '</span>',
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
'pagelink' => '<span class="screen-reader-text">' . __('Page', 'tailpress') . ' </span>%',
'separator' => '<span class="screen-reader-text">, </span>',
)
);
?>
<?php get_template_part('template-parts/components/posts/post-authors', null, array(
'postId' => get_the_ID()
)); ?>
</div>
</div>
</article>
<?php endwhile; ?>