84 lines
3.5 KiB
PHP
84 lines
3.5 KiB
PHP
<?php
|
|
if ( ! defined( 'ABSPATH' ) ) exit; // If this file is called directly, abort.
|
|
|
|
$upstudy_post_thumb_src = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'upstudy-post-thumb' );
|
|
if ( isset( $upstudy_post_thumb_src ) && ! empty( $upstudy_post_thumb_src ) ) :
|
|
$upstudy_post_thumb_url = $upstudy_post_thumb_src[0];
|
|
else :
|
|
$upstudy_post_thumb_url = '';
|
|
endif;
|
|
|
|
$blog_post_desktop_cols = 12/Upstudy::setting( 'blog_post_columns' );
|
|
|
|
if ( isset( $_GET['column'] ) && $_GET['column'] == 3 ) :
|
|
$blog_post_desktop_cols = 4;
|
|
endif;
|
|
|
|
$excerpt_length = Upstudy::setting( 'blog_excerpt_length' );
|
|
if ( isset( $_GET['excerpt_length'] ) ) :
|
|
$excerpt_length = (int)$_GET['excerpt_length'] ? $_GET['excerpt_length'] : $excerpt_length;
|
|
endif;
|
|
|
|
$masonry_status = Upstudy::setting( 'blog_masonry_show' );
|
|
if ( $masonry_status || isset( $_GET['masonry'] ) ) :
|
|
$blog_post_desktop_cols = $blog_post_desktop_cols . ' ' . 'tpc-masonry-item';
|
|
endif;
|
|
|
|
$blog_comments_text = Upstudy::setting( 'blog_comments_text' ) ?: esc_html__('Comments', 'upstudy');
|
|
$blog_author_show = Upstudy::setting( 'blog_author_show' ) ?: true;
|
|
$blog_date_show = Upstudy::setting( 'blog_date_show' ) ?: true;
|
|
$blog_comment_show = Upstudy::setting( 'blog_comment_show' ) ?: true;
|
|
$blog_category_show = Upstudy::setting( 'blog_category_show' );
|
|
$blog_read_more_btn_show = Upstudy::setting( 'blog_read_more_btn_show' );
|
|
$blog_button_text = Upstudy::setting( 'blog_button_text' ) ?: esc_html__('Read More', 'upstudy');
|
|
|
|
?>
|
|
|
|
<div id="post-<?php the_ID(); ?>" <?php post_class( 'upstudy-post-one-single-grid upstudy-col-lg-' . esc_attr( $blog_post_desktop_cols ) . ' upstudy-col-md-6 upstudy-col-sm-12' ); ?> data-sal>
|
|
<?php
|
|
|
|
$blog_comment_short_text = Upstudy::setting( 'blog_comment_short_text' );
|
|
|
|
echo '<div class="edu-blog blog-style-1">';
|
|
echo '<div class="inner">';
|
|
|
|
if ( $upstudy_post_thumb_url ) :
|
|
echo '<div class="thumbnail">';
|
|
echo '<a href="' . esc_url( get_the_permalink() ) . '">';
|
|
echo '<img src="' . esc_url( $upstudy_post_thumb_url ). '" alt="' . esc_attr( upstudy_thumbanil_alt_text( get_post_thumbnail_id( get_the_id() ) ) ). '" >';
|
|
echo '</a>';
|
|
echo '</div>';
|
|
endif;
|
|
|
|
echo '<div class="content">';
|
|
|
|
echo '<ul class="blog-meta">';
|
|
|
|
if ( $blog_category_show && upstudy_category_by_id( get_the_ID() )) {
|
|
echo '<li class="meta-blog-cat">';
|
|
echo wp_kses_post( upstudy_category_by_id( get_the_ID(), 'category' ) );
|
|
echo '</li>';
|
|
}
|
|
|
|
if ( $blog_date_show ) {
|
|
echo '<li>' . esc_html( get_the_date() ) . '</li>';
|
|
}
|
|
|
|
echo '</ul>';
|
|
|
|
echo upstudy_get_title( 'h4' );
|
|
|
|
echo wpautop( wp_trim_words( wp_kses_post( get_the_excerpt() ), esc_html( $excerpt_length ), '...' ) );
|
|
|
|
if ( $blog_read_more_btn_show ) {
|
|
echo '<div class="upstudy-blog-readmore">';
|
|
echo '<a class="upstudy-blog-btn" href="' . esc_url( get_the_permalink() ) . '">';
|
|
echo esc_html( $blog_button_text );
|
|
echo '</a>';
|
|
echo '</div>';
|
|
}
|
|
|
|
echo '</div>';
|
|
echo '</div>';
|
|
echo '</div>';
|
|
echo '</div>';
|