File: /mnt/home/lcipakco/public_html/wp-content/themes/convis/template-parts/contents/content.php
<?php
/**
* Template part for displaying posts
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package Convis
*/
use ConvisTheme\Classes\Convis_Helper as Helper;
use ConvisTheme\Classes\Convis_Post_Helper;
$show_category = Helper::get_option( 'archive_post_category', 'yes' );
$post_author = Helper::get_option( 'archive_post_author', 'yes' );
$post_date = Helper::get_option( 'archive_post_date', 'yes' );
$show_excerpt = Helper::get_option( 'archive_post_excerpt', 'no' );
$excerpt_count = Helper::get_option( 'post_excerpt_count', 10 );
$show_button = Helper::get_option( 'archive_post_button', 'yes' );
$button_text = Helper::get_option( 'post_button_text', __( 'Read More', 'convis' ) );
$post_class = [ 'entry-post', 'clearfix' ];
if ( ! has_post_thumbnail() ) {
$post_class[] = 'no-thumbnail';
}
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( $post_class ); ?>>
<?php Convis_Post_Helper::render_media(); ?>
<div class="entry-summary">
<?php
if ( 'yes' === $show_category ) {
echo get_the_category_list();
}
if ( 'product' !== get_post_type() && ( 'yes' === $post_author || 'yes' === $post_date ) ) {
Convis_Post_Helper::post_archive_meta();
}
the_title( '<h3 class="post-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );
if ( 'yes' === $show_excerpt ) {
if ( has_excerpt() ) {
echo wpautop( wp_trim_words( get_the_excerpt(), $excerpt_count, '...' ) );
} else {
echo wpautop( wp_trim_words( get_the_content(), $excerpt_count, '...' ) );
}
}
if ( 'yes' === $show_button && ! empty( $button_text ) ) {
if ( 'product' === get_post_type() ) {
echo '<a class="read-more" href="' . esc_url( get_permalink() ) . '">' . esc_html__( 'View Product', 'convis' ) . '<i class="far fa-arrow-right"></i></a>';
} else {
echo '<a class="read-more" href="' . esc_url( get_permalink() ) . '">' . esc_html( $button_text ) . '<i class="far fa-arrow-right"></i></a>';
}
}
?>
</div>
</article>