Guest User

Untitled

a guest
Aug 11th, 2019
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.16 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Blog Loop File
  4.  *
  5.  * Loop file of blog.
  6.  *
  7.  * @since   3.0.0
  8.  * @package RH/modern
  9.  */
  10.  
  11. if ( have_posts() ) : ?>
  12.  
  13.     <div class="rh_blog rh_blog__listing">
  14.  
  15.         <?php
  16.         while ( have_posts() ) :
  17.             the_post();
  18.  
  19.             $format = get_post_format( get_the_ID() );
  20.             if ( false === $format ) {
  21.                 $format = 'standard';
  22.             }
  23.  
  24.             // Header margin fix in case of no thumbnail for a blog post.
  25.             $article_classes = 'rh_blog__post rh_blog--index';
  26.             if ( ! has_post_thumbnail() ) {
  27.                 $article_classes .= ' entry-header-margin-fix';
  28.             }
  29.             ?>
  30.             <article id="post-<?php the_ID(); ?>" <?php post_class( $article_classes ); ?> >
  31.  
  32.                 <?php
  33.                 // Image, gallery or video based on format.
  34.                 if ( in_array( $format, array( 'standard', 'image', 'gallery', 'video' ), true ) ) :
  35.                     get_template_part( 'assets/modern/partials/blog/post-formats/' . $format );
  36.                 endif;
  37.                 ?>
  38.  
  39.                 <div class="entry-header blog-post-entry-header">
  40.                     <?php
  41.                     // Post title.
  42.                     get_template_part( 'assets/modern/partials/blog/post/title' );
  43.  
  44.                     // Post meta.
  45.                     get_template_part( 'assets/modern/partials/blog/post/meta' );
  46.                     ?>
  47.                 </div>
  48.  
  49.                 <div class="entry-summary">
  50.                     <?php
  51.                     if ( strpos( get_the_content(), 'more-link' ) === false ) {
  52.                         the_excerpt();
  53.                     } else {
  54.                         the_content( '' );
  55.                     }
  56.                     ?>
  57.                     <a href="<?php the_permalink(); ?>" rel="bookmark" class="rh_btn rh_btn--primary read-more"><?php esc_html_e( 'Read More', 'framework' ); ?></a>
  58.                 </div>
  59.  
  60.             </article>
  61.             <?php
  62.  
  63.         endwhile;
  64.         inspiry_theme_pagination( $wp_query->max_num_pages );
  65.         ?>
  66.  
  67.     </div>
  68.     <!-- /.rh_blog rh_blog__listing -->
  69.  
  70.     <?php
  71. else :
  72.     ?>
  73.     <div class="rh_alert-wrapper">
  74.         <h4 class="no-results"><?php esc_html_e( 'No Posts Found!', 'framework' ) ?></h4>
  75.     </div>
  76.     <?php
  77. endif;
  78. ?>
Advertisement
Add Comment
Please, Sign In to add comment