| Server IP : 213.186.33.4 / Your IP : 216.73.216.222 Web Server : Apache System : Linux webm005.cluster103.gra.hosting.ovh.net 6.18.39-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Tue Jul 21 12:03:15 CEST 2026 x86_64 User : karinebmkh ( 644538) PHP Version : 8.4.22 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/karinebmkh/www2/wp-content/themes/glaza/templates/ |
Upload File : |
<?php
/**
* @param string $classes
* @param string $tag
* render title
*/
if ( ! function_exists( 'glaza_post_title' ) ) {
function glaza_post_title( $classes = '' ) {
$class_name = 'post-title entry-title ' . esc_attr( $classes ); ?>
<h2 class="<?php echo esc_attr( trim( $class_name ) ); ?>">
<a href="<?php echo esc_url( get_permalink() ); ?>" rel="bookmark" title="<?php echo esc_attr( get_the_title() ); ?>"><?php the_title(); ?></a>
</h2>
<?php
}
}
/**
* @param string $classes
* render readmore btn
*/
if ( ! function_exists( 'glaza_post_readmore' ) ) {
function glaza_post_readmore( $settings = array() ) {
$read_more_text = glaza_get_option( 'readmore_text' );
if ( empty( $settings['readmore'] ) || empty( $read_more_text ) ) {
return false;
} ?>
<div class="post-btn btn-wrap">
<a class="btn" href="<?php echo get_permalink(); ?>" rel="bookmark"><?php echo esc_html( $read_more_text ); ?></a>
</div>
<?php
}
}
/**
* @param string $size
* @param string $classes
* featured image
*/
if ( ! function_exists( 'glaza_post_thumb' ) ) {
function glaza_post_thumb( $size = 'full', $classes = '' ) {
$smooth_display = glaza_get_option( 'smooth_display' );
$class_name = array();
$class_name[] = 'post-thumb is-image';
if ( ! empty( $smooth_display ) ) {
$class_name[] = 'animated-image faded';
}
if ( ! empty( $classes ) ) {
$class_name[] = trim( $classes );
}
$class_name = implode( ' ', $class_name ); ?>
<div class="<?php echo esc_attr( $class_name ); ?>">
<a href="<?php echo get_permalink(); ?>" title="<?php esc_attr( get_the_title() ); ?>" rel="bookmark"><?php the_post_thumbnail( $size ); ?></a>
</div>
<?php if ( current_user_can( 'edit_posts' ) ) : ?>
<?php edit_post_link( esc_html__( 'edit', 'glaza' ) ); ?>
<?php endif;
//post format
glaza_post_format_icon();
}
}
/**
* @return bool
* render icon gallery
*/
if ( ! function_exists( 'glaza_post_format_icon' ) ) {
function glaza_post_format_icon() {
switch ( get_post_format() ) {
case 'video' :
$icon = glaza_get_option( 'post_icon_video' );
if ( empty( $icon ) ) {
return false;
}
echo '<span class="post-format video"><i class="icon-simple icon-control-play"></i></span>';
break;
case 'gallery' :
$icon = glaza_get_option( 'post_icon_gallery' );
if ( empty( $icon ) ) {
return false;
}
echo '<span class="post-format glalery"><i class="icon-simple icon-picture"></i></span>';
break;
case 'audio' :
$icon = glaza_get_option( 'post_icon_audio' );
if ( empty( $icon ) ) {
return false;
}
echo '<span class="post-format glalery"><i class="icon-simple icon-music-tone-alt"></i></span>';
break;
}
}
}
/**
* meta info author
*/
if ( ! function_exists( 'glaza_post_meta_author' ) ) {
function glaza_post_meta_author() {
?>
<span class="meta-info-el meta-info-author vcard author">
<span class="meta-tagline"><?php echo glaza_translate( 'by' ) . ' '; ?></span>
<a class="url fn n" href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ) ?>"><?php the_author_meta( 'display_name' ); ?></a>
</span>
<?php
}
}
/**
* meta info date
*/
if ( ! function_exists( 'glaza_post_meta_date' ) ) {
function glaza_post_meta_date() {
$human_time = glaza_get_option( 'human_time' );
if ( ! empty( $human_time ) ) {
$timestamp = get_the_time( 'U', get_the_ID(), current_time( 'timestamp' ) );
} ?>
<span class="meta-info-el meta-info-date">
<?php if ( ! empty( $timestamp ) ) : ?>
<time class="date published" datetime="<?php echo get_the_date( DATE_W3C ); ?>"><?php echo sprintf( glaza_translate( 'ago' ), human_time_diff( $timestamp, current_time( 'timestamp' ) ) ); ?></time>
<?php else : ?>
<time class="date published" datetime="<?php echo get_the_date( DATE_W3C ); ?>"><?php echo get_the_date(); ?></time>
<?php endif;
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) : ?>
<time class="updated" datetime="<?php echo get_the_modified_date( DATE_W3C ); ?>"><?php echo get_the_modified_date(); ?></time>
<?php endif;
?>
</span>
<?php
}
}
/**
* meta info comment
*/
if ( ! function_exists( 'glaza_post_meta_comment' ) ) {
function glaza_post_meta_comment() {
if ( ! comments_open() ) {
return false;
}
$total_comments = get_comments_number(); ?>
<span class="meta-info-el meta-info-comment">
<a href="<?php echo get_comments_link() ?>">
<?php if ( 0 == $total_comments ) : ?>
<?php echo glaza_translate( 'add_comment' ); ?>
<?php elseif ( 1 == $total_comments ) : ?>
<?php echo glaza_translate( 'comment' ); ?>
<?php
else : ?>
<?php echo sprintf( glaza_translate( 'comments' ), $total_comments ); ?>
<?php endif; ?>
</a>
</span>
<?php
}
}
/**
* @param bool $primary
* meta info category
*/
if ( ! function_exists( 'glaza_post_meta_cat' ) ) {
function glaza_post_meta_cat( $primary = true ) {
$categories = get_the_category();
if ( empty( $categories ) ) {
return false;
}
$primary_category = get_post_meta( get_the_ID(), 'glaza_meta_primary_cat', true );
if ( empty( $primary_category ) || false === $primary ) :
if ( array( $categories ) ) : ?>
<span class="meta-info-el meta-info-category">
<em class="meta-tagline"><?php echo glaza_translate( 'in' ) . ' '; ?></em>
<?php foreach ( $categories as $category ) : ?>
<a class="cat-<?php echo esc_attr( $category->term_id ); ?>" href="<?php echo esc_url( get_category_link( $category->term_id ) ); ?>" rel="category tag" title="<?php echo esc_attr( $category->name ); ?>"><?php echo esc_html( $category->name ); ?></a>
<?php endforeach; ?>
</span>
<?php endif;
else :
$primary_category_name = get_cat_name( $primary_category ); ?>
<span class="meta-info-el meta-info-category">
<em class="meta-tagline"><?php echo glaza_translate( 'in' ) . ' '; ?></em>
<a class="cat-<?php echo esc_attr( $primary_category ); ?>" href="<?php echo esc_url( get_category_link( $primary_category ) ); ?>" rel="category tag" title="<?php echo esc_attr( $primary_category_name ); ?>"><?php echo esc_html( $primary_category_name ); ?></a>
</span>
<?php endif;
}
}
/**
* meta info tag
*/
if ( ! function_exists( 'glaza_post_meta_tag' ) ) {
function glaza_post_meta_tag() {
$all_tags = get_the_tags();
if ( is_array( $all_tags ) ) : ?>
<span class="meta-info-el meta-info-tag">
<em class="meta-tagline"><?php echo glaza_translate( 'tags' ); ?></em>
<?php foreach ( $all_tags as $tag ) : ?>
<a rel="tag" href="<?php echo esc_url( get_tag_link( $tag->term_id ) ); ?>" title="<?php echo esc_attr( $tag->name ) ?>"><?php echo esc_attr( $tag->name ); ?></a>
<?php endforeach; ?>
</span>
<?php endif;
}
}
/**
* meta info view
*/
if ( ! function_exists( 'glaza_post_meta_view' ) ) {
function glaza_post_meta_view() {
if ( ! function_exists( 'pvc_get_post_views' ) ) {
return false;
}
$total_view = pvc_get_post_views( get_the_ID() );
if ( empty( $total_view ) ) {
return false;
} ?>
<span class="meta-info-el meta-info-view">
<a href="<?php echo get_permalink() ?>" title="<?php esc_attr( get_the_title() ); ?>">
<?php if ( 1 == $total_view ) {
echo glaza_translate( 'view' );
} else {
echo sprintf( glaza_translate( 'views' ), $total_view );
} ?>
</a>
</span>
<?php
}
}
/**
* @param array $override
* meta info
*/
if ( ! function_exists( 'glaza_post_meta_info' ) ) {
function glaza_post_meta_info( $override = array() ) {
$meta_info_manager = glaza_get_option( 'post_meta_info_manager' );
if ( ! empty( $override ) ) {
$meta_info_manager['enabled'] = $override;
}
if ( empty( $meta_info_manager['enabled'] ) || ! is_array( $meta_info_manager['enabled'] ) ) {
return false;
} ?>
<div class="post-meta-info">
<?php foreach ( $meta_info_manager['enabled'] as $key => $val ) {
switch ( $key ) {
case 'date' :
glaza_post_meta_date();
break;
case 'author' :
glaza_post_meta_author();
break;
case 'cat' :
glaza_post_meta_cat();
break;
case 'tag' :
glaza_post_meta_tag();
break;
case 'comment' :
glaza_post_meta_comment();
break;
case 'view' :
glaza_post_meta_view();
break;
default :
break;
};
} ?>
</div>
<?php
}
}
/**
* @param string $classes
* @param int $length
* post excerpt
*/
if ( ! function_exists( 'glaza_post_excerpt' ) ) {
function glaza_post_excerpt( $settings = array() ) {
if ( empty( $settings['excerpt'] ) ) {
return false;
}
if ( ! empty( $settings['summary'] ) && 'moretag' == $settings['summary'] ) : ?>
<div class="entry clearfix"><?php the_content( '' ); ?></div>
<?php
else :
global $post;
$text = $post->post_excerpt;
if ( empty( $text ) ) {
$text = get_the_content( '' );
$text = strip_shortcodes( $text );
$text = apply_filters( 'the_content', $text );
$text = str_replace( ']]>', ']]>', $text );
$text = wp_trim_words( $text, $settings['excerpt'], '' );
}; ?>
<div class="post-excerpt"><?php echo( wp_strip_all_tags( $text ) ); ?><span class="excerpt-dot">...</span></div>
<?php
endif;
}
}
/**
* glaza post share
*/
if ( ! function_exists( 'glaza_post_share' ) ):
function glaza_post_share() {
$post_type = get_post_type();
if ( ! function_exists( 'glaza_render_share_icon' ) || 'post' != $post_type ) {
return false;
}
$setting = array(
'facebook' => glaza_get_option( 'share_facebook' ),
'twitter' => glaza_get_option( 'share_twitter' ),
'googleplus' => glaza_get_option( 'share_googleplus' ),
'pinterest' => glaza_get_option( 'share_pinterest' ),
'linkedin' => glaza_get_option( 'share_linkedin' ),
'tumblr' => glaza_get_option( 'share_tumblr' ),
'reddit' => glaza_get_option( 'share_reddit' ),
'vk' => glaza_get_option( 'share_vk' ),
'email' => glaza_get_option( 'share_email' ),
);
if ( ! array_filter( $setting ) ) {
return false;
} ?>
<div class="post-share post-extra-el">
<a href="#" class="share-toggle"><i class="icon-simple icon-share"></i></a>
<div class="share-bar tooltips tooltips-w">
<?php glaza_render_share_icon( $setting ); ?>
</div>
</div>
<?php
}
endif;
/**
* @param array $setting
* extra share
*/
if ( ! function_exists( 'glaza_post_extra_info' ) ) :
function glaza_post_extra_info( $setting = array() ) {
?>
<div class="post-extra-info">
<?php
glaza_post_share();
glaza_post_extra_comment();
if ( ! empty( $setting['shop_icon'] ) ) {
glaza_post_extra_shop();
}
?>
</div>
<?php
}
endif;
/**
* show number of comment
*/
if ( ! function_exists( 'glaza_post_extra_comment' ) ) :
function glaza_post_extra_comment() {
if ( ! comments_open() ) {
return false;
}
$total_comments = get_comments_number(); ?>
<a class="extra-comment-info post-extra-el" href="<?php echo get_comments_link() ?>" title="<?php echo esc_attr( get_the_title() ); ?>"><i class="icon-simple icon-bubble"></i>
<span><?php if ( 0 != $total_comments ) {
echo esc_html( $total_comments );
} ?></span></a>
<?php
}
endif;
/**
* shop icon
*/
if ( ! function_exists( 'glaza_post_extra_shop' ) ) :
function glaza_post_extra_shop() {
if ( ! class_exists( 'Woocommerce' ) ) {
return false;
}
$post_id = get_the_ID();
$check = get_post_meta( $post_id, 'glaza_meta_shop_enable', true );
if ( empty( $check ) ) {
return false;
} ?>
<div class="extra-shop-info post-extra-el tooltips-w">
<a href="<?php echo get_permalink() . '#shopthepost' ?>" title="<?php echo glaza_translate( 'shop_the_post' ); ?>"><i class="icon-simple icon-handbag"></i></a>
</div>
<?php
}
endif;