<?php
/**
 * Template part for displaying posts.
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package Pen
 */

$pen_is_singular = is_singular();
?>
<article id="post-<?php the_ID(); ?>" <?php echo pen_post_classes(); /* phpcs:ignore */ ?>>
<?php
$background_image_dynamic = pen_content_title_background( $pen_is_singular, get_the_ID() );
?>
	<header class="entry-header<?php echo pen_class_lists( 'header_display_override' ); /* phpcs:ignore */ ?>"<?php if ( $background_image_dynamic ) { echo ' style="background-image:url(' . $background_image_dynamic . ');background-size:cover"'; /* phpcs:ignore */ } ?>>
<?php
if ( $pen_is_singular ) {
	the_title( '<h1 class="entry-title">', '</h1>' );
} else {
	the_title(
		sprintf(
			'<h2 class="entry-title%1$s"><a href="%2$s" rel="bookmark">',
			pen_class_lists( 'title_display_override' ),
			esc_url( get_permalink() )
		),
		'</a></h2>'
	);
}

echo pen_html_content_information( 'header' ); /* phpcs:ignore */
echo pen_html_share( 'header' ); /* phpcs:ignore */

?>
	</header><!-- .entry-header -->

<?php
pen_sidebar_get( 'sidebar-content-top' );

$thumbnail = '';
$list_type = pen_option_get( 'list_type' );
if ( ! $pen_is_singular && 'masonry' === $list_type ) {
	ob_start( 'trim' );
	get_template_part( 'partials/content', 'thumbnail' );
	$thumbnail = ob_get_clean();
	echo $thumbnail; /* phpcs:ignore */
}

ob_start( 'trim' );
if ( $pen_is_singular || ! pen_option_get( 'list_excerpt' ) ) {
	the_content(
		sprintf(
			wp_kses(
				/* Translators: %s: Name of current post. */
				__( 'Continue reading %s', 'pen' ),
				array(
					'span' => array(
						'class' => array(),
					),
				)
			),
			the_title( '<span class="screen-reader-text">"', '"</span>', false )
		)
	);
} else {
	the_excerpt();
}
$content = ob_get_clean();

ob_start( 'trim' );
if ( $pen_is_singular || 'plain' === $list_type ) {
	ob_start( 'trim' );
	get_template_part( 'partials/content', 'thumbnail' );
	$thumbnail = ob_get_clean();
	echo $thumbnail; /* phpcs:ignore */
}

if ( $content ) {
	?>
	<div class="pen_content_wrapper">
	<?php
	echo $content; /* phpcs:ignore */

	pen_html_pagination_content();
	?>
	</div>
	<?php
}

pen_sidebar_get( 'sidebar-content-bottom' );

$classes = trim(
	implode(
		' ',
		array_filter(
			array(
				'entry-content',
				trim( pen_class_lists( 'summary_display_override' ) ),
				$thumbnail ? 'pen_with_thumbnail' : 'post_without_thumbnail',
			)
		)
	)
);

$content = ob_get_clean();
if ( $content ) {
	?>
	<div class="<?php echo esc_attr( $classes ); ?>">
	<?php
	echo $content; /* phpcs:ignore */
	$view    = is_singular() ? 'content' : 'list';
	if($view=="content"){echo '<div style=" text-align: center; "><img alt="扫我捐助哦" src="http://blog.yoqi.me/wp-content/themes/Jianux/images/donate.gif"></div>';}
	echo pen_html_share( 'content' ); /* phpcs:ignore */
	echo pen_html_author(); /* phpcs:ignore */
	?>
	</div><!-- .entry-content -->
	<?php
}

get_template_part( 'partials/content', 'footer' );

echo pen_html_configuration_overview(); /* phpcs:ignore */

if ( $pen_is_singular ) {
	pen_html_jump_menu( 'content' );
}
?>
</article><!-- #post-<?php the_ID(); ?> -->