EduardET

custom archive page to load the divi 100 card plugin

Nov 20th, 2017
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.53 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" class="et_pb_blog_grid">
  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( 'wpc-article et_pb_post article-card' ); ?>>
  13.  
  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 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.  
  45.                 <?php if ( ! in_array( $post_format, array( 'link', 'audio', 'quote' ) ) ) : ?>
  46.                     <?php if ( ! in_array( $post_format, array( 'link', 'audio' ) ) ) : ?>
  47.                         <h2 class="entry-title wpc-article-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
  48.                     <?php endif; ?>
  49.  
  50.                     <?php
  51.                         et_divi_post_meta();
  52.  
  53.                         if ( 'on' !== et_get_option( 'divi_blog_style', 'false' ) || ( is_search() && ( 'on' === get_post_meta( get_the_ID(), '_et_pb_use_builder', true ) ) ) ) {
  54.                             truncate_post( 270 );
  55.                         } else {
  56.                             the_content();
  57.                         }
  58.                     ?>
  59.                 <?php endif; ?>
  60.  
  61.                     </article> <!-- .et_pb_post -->
  62.             <?php
  63.                     endwhile;
  64.  
  65.                     if ( function_exists( 'wp_pagenavi' ) )
  66.                         wp_pagenavi();
  67.                     else
  68.                         get_template_part( 'includes/navigation', 'index' );
  69.                 else :
  70.                     get_template_part( 'includes/no-results', 'index' );
  71.                 endif;
  72.             ?>
  73.             </div> <!-- #left-area -->
  74.  
  75.             <?php get_sidebar(); ?>
  76.         </div> <!-- #content-area -->
  77.     </div> <!-- .container -->
  78. </div> <!-- #main-content -->
  79.  
  80. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment