first commit
This commit is contained in:
199
wp-content/themes/solarify/template-parts/content-gallery.php
Normal file
199
wp-content/themes/solarify/template-parts/content-gallery.php
Normal file
@@ -0,0 +1,199 @@
|
||||
<?php
|
||||
/**
|
||||
* The default template for displaying content
|
||||
*
|
||||
* Used for both single and index/archive/search.
|
||||
*/
|
||||
|
||||
$show_post_thumbnail = ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) ? false : true;
|
||||
|
||||
//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:
|
||||
$post_layout = 'post-layout-standard';
|
||||
if ( function_exists( 'fw_get_db_post_option' ) ) {
|
||||
$post_layout = fw_get_db_post_option( $post->ID, 'post-layout', 'post-layout-standard' );
|
||||
}
|
||||
//standard feed layout (image at the top or not image at all if option is standard or has no post thumbnail)
|
||||
// if ($post_layout == 'post-layout-standard' || ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) ) :
|
||||
$small_layout = ( $post_layout == 'post-layout-standard' || ! $show_post_thumbnail ) ? false : true;
|
||||
if ( $small_layout ) : //additional markup for small layout post
|
||||
?>
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class( 'format-small-image with_background ' ); ?>>
|
||||
<div class="side-item content-padding">
|
||||
<div class="row">
|
||||
<?php solarify_post_thumbnail( $small_layout ); ?>
|
||||
<div class="col-md-6">
|
||||
|
||||
<?php else : //standard layout markup ?>
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class( 'vertical-item content-padding big-padding with_background ' ); ?>>
|
||||
<?php
|
||||
solarify_post_thumbnail();
|
||||
endif; //small_format check
|
||||
?>
|
||||
|
||||
<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( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );
|
||||
?>
|
||||
|
||||
<?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 -->
|
||||
|
||||
<?php if ( !empty( $post->post_content ) ) : ?>
|
||||
<?php if ( is_search() ) : ?>
|
||||
<div class="entry-summary">
|
||||
<?php the_excerpt(); ?>
|
||||
</div><!-- .entry-summary -->
|
||||
<?php else : ?>
|
||||
<div class="entry-content">
|
||||
<?php
|
||||
//hidding "more link" in content
|
||||
the_content( esc_html__( 'Read More', 'solarify' ) );
|
||||
|
||||
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><!-- .entry-content -->
|
||||
|
||||
<?php endif; //is_search
|
||||
endif; // content check
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
//not showing tags in feed
|
||||
//the_tags( '', '' );
|
||||
?>
|
||||
</div><!-- eof .item-content -->
|
||||
<?php if ( $small_layout ) : //additional markup for small format post ?>
|
||||
</div><!-- eof .col-md-6 -->
|
||||
</div><!-- eof .row -->
|
||||
</div><!-- eof .side-item -->
|
||||
<?php endif; //small_format
|
||||
?>
|
||||
</article><!-- #post-## -->
|
||||
|
||||
<?php endif; //is singular ?>
|
||||
Reference in New Issue
Block a user