Guest User

Untitled

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