HEX
Server: LiteSpeed
System: Linux server315.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: globfdxw (6114)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //home/globfdxw/diasporameetsafrica.com/wp-content/themes/lavelo/theme-layouts/post/content.php
<?php
/**
 * Template part for displaying posts.
 */
$lavelo_large_image =  wp_get_attachment_image_src( get_post_thumbnail_id(get_the_ID()), 'fullsize', false, '' );
$lavelo_large_image = $lavelo_large_image ? $lavelo_large_image[0] : '';
$lavelo_alt = get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true);
$lavelo_read_more_text = cs_get_option('read_more_text');
$lavelo_read_text = $lavelo_read_more_text ? $lavelo_read_more_text : esc_html__( 'Read More', 'lavelo' );
$lavelo_post_type = get_post_meta( get_the_ID(), 'post_type_metabox', true );
$lavelo_metas_hide = (array) cs_get_option( 'theme_metas_hide' );
  // Sticky
$post_class = get_post_class();
$find_sticky = array_search( 'sticky', $post_class );

if ( 'gallery' == get_post_format() && ! empty( $lavelo_post_type['gallery_post_format'] ) ) {
  $post_format_class = ' slider-post';
} elseif ( 'video' == get_post_format() && ! empty( $lavelo_post_type['video_post_format'] ) ) {
  $post_format_class = ' video-post';
}  elseif ( 'quote' == get_post_format() && ! empty( $lavelo_post_type['quote_post_format'] ) ) {
  $post_format_class = ' quote-post';
} else {
  $post_format_class = ' ';
}
?>
 <div <?php post_class('post'.$post_format_class); ?>>
  <?php
    if ( $find_sticky ) {
        echo '<div class="sticky-badge"><h2>Featured</h2></div>';
    }
    if ( 'gallery' == get_post_format() && ! empty( $lavelo_post_type['gallery_post_format'] ) ) { ?>
    <div class="entry-media post-slider"
        data-nav="true"
        data-autoplay="true"
        data-auto-height="true"
        data-dots="true">
    <?php
      $lavelo_ids = explode( ',', $lavelo_post_type['gallery_post_format'] );
      foreach ( $lavelo_ids as $id ) {
        $lavelo_attachment = wp_get_attachment_image_src( $id, 'full' );
        $lavelo_alt = get_post_meta($id, '_wp_attachment_image_alt', true);
        echo '<img src="'. esc_url( $lavelo_attachment[0] ) .'" alt="'. esc_attr( $lavelo_alt ) .'" />';
      }
    ?>
   </div>
  <?php } elseif ( 'video' == get_post_format() && ! empty( $lavelo_post_type['video_post_format'] ) ) { ?>
    <div class="entry-media video-holder">
    	<?php if($lavelo_large_image){ ?>
        <img src="<?php echo esc_url( $lavelo_large_image ); ?>" alt="<?php echo esc_attr( $lavelo_alt ); ?>">
       <?php } ?>
        <a href="<?php echo esc_url( $lavelo_post_type['video_post_format'] ); ?>?autoplay=1" class="video-btn" data-type="iframe">
            <i class="fi flaticon-play-button"></i>
        </a>
    </div>
   <?php } elseif ( $lavelo_large_image ) { ?>
    <div class="entry-media">
        <img src="<?php echo esc_url( $lavelo_large_image ); ?>" alt="<?php echo esc_attr( $lavelo_alt ); ?>">
    </div>
    <?php } ?>
    <h3><a href="<?php echo esc_url( get_permalink() ); ?>"><?php echo get_the_title(); ?></a></h3>
    <ul class="meta">
        <li>
        <?php if ( !in_array( 'author', $lavelo_metas_hide ) ) { // Author Hide
             printf( esc_html__(' by','lavelo') .' <a href="%1$s" rel="author">%2$s</a>',
                esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
                get_the_author()
              );
          } ?>
        </li>
        <li><a href="<?php echo esc_url( get_permalink() ); ?>"><?php echo esc_html( get_the_date() );  ?></a></li>
        <li>
          <a class="lavelo-comment" href="<?php echo esc_url( get_comments_link() ); ?>">
            <?php printf( esc_html( _nx( 'Comment (%1$s)', 'Comments (%1$s)', get_comments_number(), 'comments title', 'lavelo' ) ), number_format_i18n( get_comments_number() ),'<span>' . get_the_title() . '</span>' ); ?>
          </a>
        </li>
    </ul>
    <div class="entry-details">
        <p><?php
              $blog_excerpt = cs_get_option('theme_blog_excerpt');
              if ($blog_excerpt) {
                $blog_excerpt = $blog_excerpt;
              } else {
                $blog_excerpt = '25';
              }
              lavelo_excerpt($blog_excerpt);
              echo lavelo_wp_link_pages();
          ?></p>
        <a href="<?php echo esc_url( get_permalink() ); ?>" class="read-more"><?php echo esc_attr($lavelo_read_text); ?></a>
    </div>
</div>