2023-01-21 01:31:34 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Partial: Post
|
|
|
|
*
|
|
|
|
* Renders a list of full-width posts paginated using the "Blog pages show at most"
|
|
|
|
* (posts_per_page) option under Settings > Reading.
|
|
|
|
*
|
|
|
|
* @package WordPress
|
|
|
|
* @subpackage Fictioneer
|
|
|
|
* @since 2.0
|
|
|
|
* @see partials/_loop.php
|
2023-03-10 15:35:55 +01:00
|
|
|
*
|
2024-10-14 11:36:10 +02:00
|
|
|
* @internal $args['nested'] Whether the post is nested inside another query. Default null.
|
|
|
|
* @internal $args['context'] Render context of the partial ('loop' or 'shortcode_fictioneer_blog').
|
2023-01-21 01:31:34 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2023-08-20 20:21:48 +02:00
|
|
|
// No direct access!
|
|
|
|
defined( 'ABSPATH' ) OR exit;
|
|
|
|
|
2023-01-21 01:31:34 +01:00
|
|
|
// Setup
|
2023-12-02 11:58:58 +01:00
|
|
|
$post_id = get_the_ID();
|
2024-03-01 12:39:42 +01:00
|
|
|
$title = fictioneer_get_safe_title( $post_id, 'post' );
|
2023-01-23 04:09:45 +01:00
|
|
|
$label = esc_attr( sprintf( _x( 'Continue reading %s', 'Read more link aria label', 'fictioneer' ), $title ) );
|
2023-01-21 01:31:34 +01:00
|
|
|
|
|
|
|
if (
|
|
|
|
! get_option( 'fictioneer_show_full_post_content' ) &&
|
|
|
|
! strpos( $post->post_content, '<!--more-->' )
|
|
|
|
) {
|
2024-02-28 16:19:26 +01:00
|
|
|
$content = '<p>' . fictioneer_get_excerpt() . '</p><div class="more-link-wrapper"><a class="more-link" href="' . get_permalink() . '" title="' . $label . '" aria-label="' . $label . '">' . fcntr( 'read_more' ) . '</a></div>';
|
2023-08-04 11:21:56 +02:00
|
|
|
} else {
|
|
|
|
$content = apply_filters( 'the_content', get_the_content( fcntr( 'read_more' ) ) );
|
2023-01-21 01:31:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
2024-08-12 02:42:45 +02:00
|
|
|
<article id="post-<?php echo $post_id; ?>" class="post">
|
2023-01-21 01:31:34 +01:00
|
|
|
|
2024-10-14 11:40:05 +02:00
|
|
|
<?php do_action( 'fictioneer_post_article_open', $post_id, $args ); ?>
|
|
|
|
|
2023-01-21 01:31:34 +01:00
|
|
|
<header class="post__header">
|
2024-10-14 13:00:44 +02:00
|
|
|
<?php
|
|
|
|
$header_items = array(
|
|
|
|
'title' => '<h2 class="post__title h1"><a href="' . get_the_permalink() . '">' . $title . '</a></h2>',
|
|
|
|
'meta' => '<div class="post__meta layout-links">' . fictioneer_get_post_meta_items() . '</div>'
|
|
|
|
);
|
|
|
|
|
|
|
|
$header_items = apply_filters( 'fictioneer_filter_post_header_items', $header_items, $post_id, $args );
|
|
|
|
|
|
|
|
echo implode( '', $header_items );
|
|
|
|
?>
|
2023-01-21 01:31:34 +01:00
|
|
|
</header>
|
|
|
|
|
|
|
|
<section class="post__main content-section"><?php echo $content; ?></section>
|
|
|
|
|
2024-10-14 11:36:10 +02:00
|
|
|
<?php do_action( 'fictioneer_post_after_content', $post_id, $args ); ?>
|
|
|
|
|
|
|
|
<?php if ( 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">
|
2024-10-14 11:36:10 +02:00
|
|
|
<?php do_action( 'fictioneer_post_footer_left', $post_id, $args ); ?>
|
2023-01-21 01:31:34 +01:00
|
|
|
</div>
|
2023-08-30 13:51:49 +02:00
|
|
|
<div class="post__footer-box post__footer-right">
|
2024-10-14 11:36:10 +02:00
|
|
|
<?php do_action( 'fictioneer_post_footer_right', $post_id, $args ); ?>
|
2023-01-21 01:31:34 +01:00
|
|
|
</div>
|
|
|
|
</footer>
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
</article>
|