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
|
|
|
*
|
2023-08-19 22:22:56 +02:00
|
|
|
* @internal $args['nested'] Whether the post is nested inside another query. Default null.
|
2023-01-21 01:31:34 +01:00
|
|
|
*/
|
|
|
|
?>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
2023-08-20 20:21:48 +02:00
|
|
|
// No direct access!
|
|
|
|
defined( 'ABSPATH' ) OR exit;
|
|
|
|
|
2023-01-21 01:31:34 +01:00
|
|
|
// Setup
|
|
|
|
$title = fictioneer_get_safe_title( get_the_ID() );
|
2023-01-23 04:09:45 +01:00
|
|
|
$label = esc_attr( sprintf( _x( 'Continue reading %s', 'Read more link aria label', 'fictioneer' ), $title ) );
|
2023-03-10 15:35:55 +01:00
|
|
|
$nested = $args['nested'] ?? false;
|
2023-01-21 01:31:34 +01:00
|
|
|
|
|
|
|
// Password?
|
|
|
|
if ( post_password_required() ) {
|
|
|
|
$title .= ' <i class="fa-solid fa-lock password-icon"></i>';
|
|
|
|
}
|
|
|
|
|
|
|
|
if (
|
|
|
|
! get_option( 'fictioneer_show_full_post_content' ) &&
|
|
|
|
! strpos( $post->post_content, '<!--more-->' )
|
|
|
|
) {
|
2023-01-23 04:09:45 +01:00
|
|
|
$content = '<p>' . fictioneer_get_excerpt() . '</p><a class="more-link" href="' . get_permalink() . '" title="' . $label . '" aria-label="' . $label . '">' . fcntr( 'read_more' ) . '</a>';
|
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
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
2023-03-10 15:35:55 +01:00
|
|
|
<article id="post-<?php the_ID(); ?>" class="post <?php if ( ! $nested ) echo 'padding-left padding-right'; ?>">
|
2023-01-21 01:31:34 +01:00
|
|
|
|
|
|
|
<header class="post__header">
|
|
|
|
<h2 class="post__title"><a href="<?php the_permalink(); ?>"><?php echo $title; ?></a></h2>
|
|
|
|
<div class="post__meta layout-links"><?php echo fictioneer_get_post_meta_items(); ?></div>
|
|
|
|
</header>
|
|
|
|
|
|
|
|
<section class="post__main content-section"><?php echo $content; ?></section>
|
|
|
|
|
|
|
|
<?php if ( has_action( 'fictioneer_blog_posts_footers_left' ) || has_action( 'fictioneer_blog_posts_footers_right' ) ) : ?>
|
|
|
|
<footer class="post__footer">
|
|
|
|
<div class="post__footer-left">
|
|
|
|
<?php do_action( 'fictioneer_blog_posts_footers_left', get_the_ID() ); ?>
|
|
|
|
</div>
|
|
|
|
<div class="post__footer-right">
|
|
|
|
<?php do_action( 'fictioneer_blog_posts_footers_right', get_the_ID() ); ?>
|
|
|
|
</div>
|
|
|
|
</footer>
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
</article>
|