EduardET

archive.php

Feb 6th, 2018
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.58 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3. <div id="main-content">
  4.     <div class="container">
  5.         <div id="content-area" class="clearfix">
  6.             <div id="left-area">
  7.         <?php
  8.             if ( have_posts() ) :
  9.                 while ( have_posts() ) : the_post();
  10.                     $post_format = et_pb_post_format(); ?>
  11.  
  12.                     <article id="post-<?php the_ID(); ?>" <?php post_class( 'et_pb_post clearfix' ); ?>>
  13.                     <div class="left-box">
  14.                 <?php
  15.                     $thumb = '';
  16.  
  17.                     $width = (int) apply_filters( 'et_pb_index_blog_image_width', 1080 );
  18.  
  19.                     $height = (int) apply_filters( 'et_pb_index_blog_image_height', 675 );
  20.                     $classtext = 'et_pb_post_main_image';
  21.                     $titletext = get_the_title();
  22.                     $thumbnail = get_thumbnail( $width, $height, $classtext, $titletext, $titletext, false, 'Blogimage' );
  23.                     $thumb = $thumbnail["thumb"];
  24.  
  25.                     et_divi_post_format_content();
  26.  
  27.                     if ( ! in_array( $post_format, array( 'link', 'audio', 'quote' ) ) ) {
  28.                         if ( 'video' === $post_format && false !== ( $first_video = et_get_first_video() ) ) :
  29.                             printf(
  30.                                 '<div class="et_main_video_container">
  31.                                     %1$s
  32.                                 </div>',
  33.                                 $first_video
  34.                             );
  35.                         elseif ( ! in_array( $post_format, array( 'gallery' ) ) && 'on' === et_get_option( 'divi_thumbnails_index', 'on' ) && '' !== $thumb ) : ?>
  36.                             <a class="entry-featured-image-url" href="<?php the_permalink(); ?>">
  37.                                 <?php print_thumbnail( $thumb, $thumbnail["use_timthumb"], $titletext, $width, $height ); ?>
  38.                             </a>
  39.                     <?php
  40.                         elseif ( 'gallery' === $post_format ) :
  41.                             et_pb_gallery_images();
  42.                         endif;
  43.                     } ?>
  44.                 </div>
  45.                 <div class="right-box">
  46.                 <?php if ( ! in_array( $post_format, array( 'link', 'audio', 'quote' ) ) ) : ?>
  47.                     <?php if ( ! in_array( $post_format, array( 'link', 'audio' ) ) ) : ?>
  48.                         <h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
  49.                     <?php endif; ?>
  50.  
  51.                     <?php
  52.                         et_divi_post_meta();
  53.  
  54.                         if ( 'on' !== et_get_option( 'divi_blog_style', 'false' ) || ( is_search() && ( 'on' === get_post_meta( get_the_ID(), '_et_pb_use_builder', true ) ) ) ) {
  55.                             truncate_post( 270 );
  56.                         } else {
  57.                             the_content();
  58.                         }
  59.                     ?>
  60.                 <?php endif; ?>
  61.                 </div>
  62.                     </article> <!-- .et_pb_post -->
  63.             <?php
  64.                     endwhile;
  65.  
  66.                     if ( function_exists( 'wp_pagenavi' ) )
  67.                         wp_pagenavi();
  68.                     else
  69.                         get_template_part( 'includes/navigation', 'index' );
  70.                 else :
  71.                     get_template_part( 'includes/no-results', 'index' );
  72.                 endif;
  73.             ?>
  74.             </div> <!-- #left-area -->
  75.  
  76.             <?php get_sidebar(); ?>
  77.         </div> <!-- #content-area -->
  78.     </div> <!-- .container -->
  79. </div> <!-- #main-content -->
  80.  
  81. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment