168 lines
6.4 KiB
PHP
168 lines
6.4 KiB
PHP
<?php
|
|
/**
|
|
* The default template for displaying content
|
|
*
|
|
* Used for both single and index/archive/search.
|
|
*/
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
exit; // Exit if accessed directly
|
|
}
|
|
|
|
$show_post_thumbnail = ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) ? false : true;
|
|
|
|
$post_thumbnail = get_the_post_thumbnail( get_the_ID() );
|
|
$additional_post_class = ( $post_thumbnail ) ? 'bg_teaser after_cover darkblue_bg' : '';
|
|
|
|
//single item layout
|
|
if ( is_singular() ) : ?>
|
|
<article id="post-<?php the_ID(); ?>" <?php post_class( 'vertical-item content-padding big-padding with_background' ); ?>>
|
|
<?php solarify_post_thumbnail(); ?>
|
|
|
|
<div class="item-content">
|
|
<header class="entry-header side-meta">
|
|
|
|
<div class="entry-meta darklinks grey">
|
|
<?php
|
|
if ( 'post' == get_post_type() ) {
|
|
printf( '<span class="entry-date"><i class="fa fa-clock-o" aria-hidden="true"></i> <a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s">%3$s</time></a></span>',
|
|
esc_url( get_permalink() ),
|
|
esc_attr( get_the_date( 'c' ) ),
|
|
esc_html( get_the_date() )
|
|
);
|
|
}
|
|
printf( '<span class="author vcard highlightlinks"><i class="fa fa-user" aria-hidden="true"></i> <a class="url fn n" href="%2$s" rel="author">%1$s %3$s</a></span>',
|
|
esc_html_x( 'by ', 'Used before post author name.', 'solarify' ),
|
|
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
|
|
get_the_author()
|
|
); ?>
|
|
<span>
|
|
<i class="fa fa-comments" aria-hidden="true"></i>
|
|
<?php if ( comments_open( get_the_ID() ) ) : ?>
|
|
<a href="<?php comments_link(); ?>">
|
|
<?php
|
|
comments_number( 'no comments', '1 comment', '% comments');
|
|
?>
|
|
</a>
|
|
<?php
|
|
else:
|
|
echo esc_html__( ' comments closed', 'solarify' );
|
|
endif; ?>
|
|
</span>
|
|
</div>
|
|
|
|
<div class="header-body">
|
|
<?php
|
|
the_title( '<h1 class="entry-title">', '</h1>' );
|
|
?>
|
|
|
|
<?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) ) : ?>
|
|
|
|
<div class="categories-links highlightlinks"><?php echo get_the_category_list( esc_html_x( ' ', 'Used between list items, there is a space after the comma.', 'solarify' ) ); ?></div>
|
|
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
</header><!-- .entry-header -->
|
|
|
|
<div class="entry-content">
|
|
<?php
|
|
the_content( esc_html__( 'Read More', 'solarify' ) );
|
|
?>
|
|
</div><!-- .entry-content -->
|
|
|
|
<?php
|
|
the_tags( '<div class="tag-links theme_buttons color2">', ' ', '</div>' );
|
|
|
|
wp_link_pages( array(
|
|
'before' => '<div class="page-links highlightlinks topmargin_30"><span class="page-links-title">' . esc_html__( 'Pages:', 'solarify' ) . '</span>',
|
|
'after' => '</div>',
|
|
'link_before' => '<span>',
|
|
'link_after' => '</span>',
|
|
) );
|
|
?>
|
|
</div>
|
|
|
|
</article><!-- #post-## -->
|
|
<?php
|
|
solarify_post_nav();
|
|
solarify_list_authors();
|
|
?>
|
|
<?php
|
|
//eof single page layout
|
|
//blog feed layout
|
|
else: ?>
|
|
<article id="post-<?php the_ID(); ?>" <?php post_class( 'ds bs vertical-item content-padding big-padding text-center ' . $additional_post_class ); ?>>
|
|
<?php
|
|
echo wp_kses_post ( $post_thumbnail );
|
|
?>
|
|
|
|
<div class="item-content entry-content">
|
|
<header class="entry-header">
|
|
|
|
<div class="entry-meta">
|
|
<?php
|
|
global $post;
|
|
echo get_avatar( $post->post_author ); ?>
|
|
|
|
<?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) ) : ?>
|
|
|
|
<div class="categories-links highlightlinks topmargin_20"><?php echo get_the_category_list( esc_html_x( ' ', 'Used between list items, there is a space after the comma.', 'solarify' ) ); ?></div>
|
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
the_title( '<h3 class="entry-title topmargin_20"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );
|
|
?>
|
|
|
|
</header><!-- .entry-header -->
|
|
|
|
<?php if ( is_search() ) : ?>
|
|
<div class="entry-summary">
|
|
<?php
|
|
the_excerpt();
|
|
?>
|
|
</div><!-- .entry-summary -->
|
|
<?php else : ?>
|
|
<div class="entry-content">
|
|
<?php
|
|
the_content( esc_html__( 'Read More', 'solarify' ) );
|
|
?>
|
|
</div><!-- .entry-content -->
|
|
<?php endif; //is_search ?>
|
|
|
|
<div class="entry-meta">
|
|
<div class="inline-content darklinks grey">
|
|
<?php
|
|
if ( 'post' == get_post_type() ) {
|
|
printf( '<span class="entry-date"><i class="fa fa-clock-o" aria-hidden="true"></i> <a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s">%3$s</time></a></span>',
|
|
esc_url( get_permalink() ),
|
|
esc_attr( get_the_date( 'c' ) ),
|
|
esc_html( get_the_date() )
|
|
);
|
|
}
|
|
printf( '<span class="author vcard highlightlinks"><i class="fa fa-user" aria-hidden="true"></i> <a class="url fn n" href="%2$s" rel="author">%1$s %3$s</a></span>',
|
|
esc_html_x( 'by ', 'Used before post author name.', 'solarify' ),
|
|
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
|
|
get_the_author()
|
|
); ?>
|
|
<span>
|
|
<i class="fa fa-comments" aria-hidden="true"></i>
|
|
<?php if ( comments_open( get_the_ID() ) ) : ?>
|
|
<a href="<?php comments_link(); ?>">
|
|
<?php
|
|
comments_number( 'no comments', '1 comment', '% comments');
|
|
?>
|
|
</a>
|
|
<?php
|
|
else:
|
|
echo esc_html__( ' comments closed', 'solarify' );
|
|
endif; ?>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div><!-- eof .item-content -->
|
|
</article><!-- #post-## -->
|
|
<?php endif; //is singular
|