File: /home/frenchy/refonte2023/wordpress/wp-content/themes/gimont/template-parts/parts/meta.php
<?php if( !is_search() ){
if( is_single() ){
$show_date = gimont_post_show_date() == 'yes' ? true: false;
$show_cat = gimont_post_show_cat() == 'yes' ? true: false;
$show_author = gimont_post_show_author() == 'yes' ? true: false;
$show_comment = gimont_post_show_comment() == 'yes' ? true: false;
}else{
$show_date = gimont_blog_show_date() == 'yes' ? true: false;
$show_cat = gimont_blog_show_cat() == 'yes' ? true: false;
$show_author = gimont_blog_show_author() == 'yes' ? true: false;
$show_comment = gimont_blog_show_comment() == 'yes' ? true: false;
}
?>
<?php if( $show_date || $show_cat || $show_author || $show_comment ){ ?>
<ul class="post-meta">
<?php } ?>
<?php if( $show_date ){ ?>
<li class="date">
<i class="ovaicon-calendar-1"></i>
<?php the_time( get_option( 'date_format' ));?>
</li>
<?php } ?>
<?php if( $show_cat ) { $categories = get_the_category(); ?>
<?php if( $categories && is_array($categories) ) { ?>
<li class="category">
<i class="ovaicon-folder-1"></i>
<?php
printf( '<a href="%s">%s</a>', esc_url( get_category_link( $categories[0]->term_id ) ), esc_html( $categories[0]->name ) ) ;
?>
</li>
<?php } ?>
<?php } ?>
<?php if( $show_author ){ ?>
<li class="author">
<i class="ovaicon-user-1"></i>
<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>">
<?php the_author_meta( 'display_name' ); ?>
</a>
</li>
<?php } ?>
<?php if( $show_comment ){ ?>
<li class="comment">
<i class="ovaicon-chat-comment-oval-speech-bubble-with-text-lines"></i>
<?php comments_popup_link(
esc_html__(' 0 Comments', 'gimont'),
esc_html__(' 1 Comment', 'gimont'),
' % '.esc_html__('Comments', 'gimont'),
'',
esc_html__( 'Comment off', 'gimont' )
); ?>
</li>
<?php } ?>
<?php if( $show_date || $show_cat || $show_author || $show_comment ){ ?>
</ul>
<?php } ?>
<?php } ?>