Guest User

Untitled

a guest
Mar 19th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.02 KB | None | 0 0
  1. <?php
  2.  
  3. get_header();
  4.  
  5. $show_default_title = get_post_meta( get_the_ID(), '_et_pb_show_title', true );
  6.  
  7. $is_page_builder_used = et_pb_is_pagebuilder_used( get_the_ID() );
  8.  
  9. ?>
  10.  
  11. <div id="main-content">
  12. <?php
  13. if ( et_builder_is_product_tour_enabled() ):
  14. // load fullwidth page in Product Tour mode
  15. while ( have_posts() ): the_post(); ?>
  16.  
  17. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  18. <div class="entry-content">
  19. <?php
  20. the_content();
  21. ?>
  22. </div> <!-- .entry-content -->
  23.  
  24. </article> <!-- .et_pb_post -->
  25.  
  26. <?php endwhile;
  27. else:
  28. ?>
  29. <div class="container">
  30. <div id="content-area" class="clearfix">
  31. <div id="left-area">
  32. <?php while ( have_posts() ) : the_post(); ?>
  33. <?php if (et_get_option('divi_integration_single_top') <> '' && et_get_option('divi_integrate_singletop_enable') == 'on') echo(et_get_option('divi_integration_single_top')); ?>
  34. <article id="post-<?php the_ID(); ?>" <?php post_class( 'et_pb_post' ); ?>>
  35. <?php if ( ( 'off' !== $show_default_title && $is_page_builder_used ) || ! $is_page_builder_used ) { ?>
  36. <div class="et_post_meta_wrapper">
  37.  
  38.  
  39. <?php
  40. if ( ! post_password_required() ) :
  41.  
  42. $thumb = '';
  43.  
  44. $width = (int) apply_filters( 'et_pb_index_blog_image_width', 1080 );
  45.  
  46. $height = (int) apply_filters( 'et_pb_index_blog_image_height', 675 );
  47. $classtext = 'et_featured_image';
  48. $titletext = get_the_title();
  49. $thumbnail = get_thumbnail( $width, $height, $classtext, $titletext, $titletext, false, 'Blogimage' );
  50. $thumb = $thumbnail["thumb"];
  51.  
  52. $post_format = et_pb_post_format();
  53.  
  54. if ( 'video' === $post_format && false !== ( $first_video = et_get_first_video() ) ) {
  55. printf(
  56. '<div class="et_main_video_container">
  57. %1$s
  58. </div>',
  59. $first_video
  60. );
  61. } else if ( ! in_array( $post_format, array( 'gallery', 'link', 'quote' ) ) && 'on' === et_get_option( 'divi_thumbnails', 'on' ) && '' !== $thumb ) {
  62. print_thumbnail( $thumb, $thumbnail["use_timthumb"], $titletext, $width, $height );
  63. } else if ( 'gallery' === $post_format ) {
  64. et_pb_gallery_images();
  65. }
  66. ?>
  67.  
  68. <?php
  69. $text_color_class = et_divi_get_post_text_color();
  70.  
  71. $inline_style = et_divi_get_post_bg_inline_style();
  72.  
  73. switch ( $post_format ) {
  74. case 'audio' :
  75. $audio_player = et_pb_get_audio_player();
  76.  
  77. if ( $audio_player ) {
  78. printf(
  79. '<div class="et_audio_content%1$s"%2$s>
  80. %3$s
  81. </div>',
  82. esc_attr( $text_color_class ),
  83. $inline_style,
  84. $audio_player
  85. );
  86. }
  87.  
  88. break;
  89. case 'quote' :
  90. printf(
  91. '<div class="et_quote_content%2$s"%3$s>
  92. %1$s
  93. </div> <!-- .et_quote_content -->',
  94. et_get_blockquote_in_content(),
  95. esc_attr( $text_color_class ),
  96. $inline_style
  97. );
  98.  
  99. break;
  100. case 'link' :
  101. printf(
  102. '<div class="et_link_content%3$s"%4$s>
  103. <a href="%1$s" class="et_link_main_url">%2$s</a>
  104. </div> <!-- .et_link_content -->',
  105. esc_url( et_get_link_url() ),
  106. esc_html( et_get_link_url() ),
  107. esc_attr( $text_color_class ),
  108. $inline_style
  109. );
  110.  
  111. break;
  112. }
  113.  
  114. endif;
  115. ?>
  116. <h1 class="entry-title"><?php the_title(); ?></h1>
  117. <?php et_divi_post_meta(); ?>
  118. </div> <!-- .et_post_meta_wrapper -->
  119. <?php } ?>
  120.  
  121. <div class="entry-content">
  122. <?php
  123. do_action( 'et_before_content' );
  124.  
  125. the_content();
  126.  
  127. wp_link_pages( array( 'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'Divi' ), 'after' => '</div>' ) );
  128. ?>
  129. </div> <!-- .entry-content -->
  130. <div class="et_post_meta_wrapper">
  131. <?php
  132. if ( et_get_option('divi_468_enable') == 'on' ){
  133. echo '<div class="et-single-post-ad">';
  134. if ( et_get_option('divi_468_adsense') <> '' ) echo( et_get_option('divi_468_adsense') );
  135. else { ?>
  136. <a href="<?php echo esc_url(et_get_option('divi_468_url')); ?>"><img src="<?php echo esc_attr(et_get_option('divi_468_image')); ?>" alt="468" class="foursixeight" /></a>
  137. <?php }
  138. echo '</div> <!-- .et-single-post-ad -->';
  139. }
  140. ?>
  141.  
  142. <?php if (et_get_option('divi_integration_single_bottom') <> '' && et_get_option('divi_integrate_singlebottom_enable') == 'on') echo(et_get_option('divi_integration_single_bottom')); ?>
  143.  
  144. <?php
  145. if ( ( comments_open() || get_comments_number() ) && 'on' == et_get_option( 'divi_show_postcomments', 'on' ) ) {
  146. comments_template( '', true );
  147. }
  148. ?>
  149. </div> <!-- .et_post_meta_wrapper -->
  150. </article> <!-- .et_pb_post -->
  151.  
  152. <?php endwhile; ?>
  153. </div> <!-- #left-area -->
  154.  
  155. <?php get_sidebar(); ?>
  156. </div> <!-- #content-area -->
  157. </div> <!-- .container -->
  158. <?php endif; ?>
  159. </div> <!-- #main-content -->
  160.  
  161. <?php
  162.  
  163. get_footer();
Add Comment
Please, Sign In to add comment