fictioneer/single-post.php

94 lines
2.6 KiB
PHP
Raw Normal View History

2023-01-21 01:31:34 +01:00
<?php
/**
* Single Post
*
* @package WordPress
* @subpackage Fictioneer
* @since 1.0
*/
2023-08-17 16:13:12 +02:00
// Setup
$password_required = post_password_required();
2023-08-17 16:13:12 +02:00
// Header
get_header();
?>
2023-01-21 01:31:34 +01:00
<main id="main" class="main post">
<?php do_action( 'fictioneer_main', 'post' ); ?>
2023-01-21 01:31:34 +01:00
<div class="main__wrapper">
2023-01-21 01:31:34 +01:00
<?php do_action( 'fictioneer_main_wrapper' ); ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
// Setup
$title = fictioneer_get_safe_title( $post->ID, 'single-post' );
2023-12-02 00:00:13 +01:00
$this_breadcrumb = [ $title, get_the_permalink() ];
2023-01-21 01:31:34 +01:00
?>
2024-08-12 02:42:45 +02:00
<article id="post-<?php the_ID(); ?>" class="post__article">
2023-01-21 01:31:34 +01:00
<?php do_action( 'fictioneer_post_article_open', $post->ID, array( 'context' => 'single-post' ) ); ?>
2023-01-21 01:31:34 +01:00
<header class="post__header">
2024-10-14 11:38:34 +02:00
<?php do_action( 'fictioneer_post_header_open', $post->ID, array( 'context' => 'single-post' ) ); ?>
2023-01-21 01:31:34 +01:00
<h1 class="post__title"><?php echo $title; ?></h1>
<div class="post__meta layout-links"><?php echo fictioneer_get_post_meta_items(); ?></div>
</header>
<section class="post__main content-section"><?php the_content(); ?></section>
<?php do_action( 'fictioneer_post_after_content', $post->ID, array( 'context' => 'single-post' ) ); ?>
2023-01-21 01:31:34 +01:00
<?php if ( ! $password_required && ( has_action( 'fictioneer_post_footer_left' ) || has_action( 'fictioneer_post_footer_right' ) ) ) : ?>
2023-01-21 01:31:34 +01:00
<footer class="post__footer">
2023-08-30 13:51:49 +02:00
<div class="post__footer-box post__footer-left">
<?php do_action( 'fictioneer_post_footer_left', $post->ID, array( 'context' => 'single-post' ) ); ?>
2023-08-30 13:51:49 +02:00
</div>
<div class="post__footer-box post__footer-right">
<?php do_action( 'fictioneer_post_footer_right', $post->ID, array( 'context' => 'single-post' ) ); ?>
2023-08-30 13:51:49 +02:00
</div>
2023-01-21 01:31:34 +01:00
</footer>
<?php endif; ?>
</article>
<?php do_action( 'fictioneer_before_comments' ); ?>
<?php if ( comments_open() && ! $password_required ) : ?>
2024-08-12 02:42:45 +02:00
<section class="post__comments comment-section">
2023-01-21 01:31:34 +01:00
<?php comments_template(); ?>
</section>
<?php endif; ?>
<?php endwhile; ?>
2023-01-21 01:31:34 +01:00
</div>
2024-09-07 16:57:34 +02:00
<?php do_action( 'fictioneer_main_end', 'post' ); ?>
2023-01-21 01:31:34 +01:00
</main>
<?php
// Footer arguments
$footer_args = array(
'post_type' => 'post',
2023-12-02 00:00:13 +01:00
'post_id' => $post->ID,
2023-01-21 01:31:34 +01:00
'breadcrumbs' => array(
[fcntr( 'frontpage' ), get_home_url()]
)
);
// Add current breadcrumb
$footer_args['breadcrumbs'][] = $this_breadcrumb;
// Get footer with breadcrumbs
get_footer( null, $footer_args );
?>