refactoring
This commit is contained in:
parent
de169dba95
commit
72095a7ff8
43
single.php
43
single.php
|
|
@ -1,28 +1,47 @@
|
||||||
<?php get_header(); ?>
|
<?php get_header(); ?>
|
||||||
|
|
||||||
<div class="container my-8 mx-auto">
|
<div class="container my-8 mx-auto">
|
||||||
|
|
||||||
<?php if ( have_posts() ) : ?>
|
<?php if (have_posts()) : ?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
while ( have_posts() ) :
|
while (have_posts()) :
|
||||||
the_post();
|
the_post();
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php get_template_part( 'template-parts/content', 'single' ); ?>
|
|
||||||
|
|
||||||
<?php
|
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||||
// If comments are open or we have at least one comment, load up the comment template.
|
|
||||||
if ( comments_open() || get_comments_number() ) :
|
<header class="entry-header mb-4">
|
||||||
comments_template();
|
<?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>'); ?>
|
||||||
endif;
|
<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>',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</article>
|
||||||
|
|
||||||
|
|
||||||
<?php endwhile; ?>
|
<?php endwhile; ?>
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
get_footer();
|
get_footer();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user