Advertisement
Guest User

Untitled

a guest
Jul 6th, 2018
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.66 KB | None | 0 0
  1. <?php
  2. /**
  3. * Frontpage
  4. *
  5. * @package WordPress
  6. * @subpackage Islemag.
  7. */
  8.  
  9. get_header();
  10.  
  11. $islemag_header_slider_category = esc_attr( get_theme_mod( ‚islemag_header_slider_category’, ‚all’ ) );
  12. $islemag_header_slider_max_posts = esc_attr( get_theme_mod( ‚islemag_header_slider_max_posts’, ‚6’ ) );
  13. $islemag_section1_fullwidth = get_theme_mod( ‚islemag_section1_fullwidth’, false );
  14. $islemag_section2_fullwidth = get_theme_mod( ‚islemag_section2_fullwidth’, false );
  15. $islemag_section3_fullwidth = get_theme_mod( ‚islemag_section3_fullwidth’, false );
  16. $islemag_section4_fullwidth = get_theme_mod( ‚islemag_section4_fullwidth’, false );
  17. $islemag_section5_fullwidth = get_theme_mod( ‚islemag_section5_fullwidth’, false );
  18. $islemag_header_slider_disable = (bool) get_theme_mod( ‚islemag_header_slider_disable’, false );
  19. $islemag_header_slider_random = (bool) get_theme_mod( ‚islemag_header_slider_random’, false );
  20. $islemag_section1_disable = (bool) get_theme_mod( ‚islemag_section1_disable’, false );
  21. $islemag_section2_disable = (bool) get_theme_mod( ‚islemag_section2_disable’, false );
  22. $islemag_section3_disable = (bool) get_theme_mod( ‚islemag_section3_disable’, false );
  23. $islemag_section4_disable = (bool) get_theme_mod( ‚islemag_section4_disable’, false );
  24. $islemag_section5_disable = (bool) get_theme_mod( ‚islemag_section5_disable’, false );
  25.  
  26. $wp_query = new WP_Query(
  27. array(
  28. ‚posts_per_page’ => $islemag_header_slider_max_posts,
  29. ‚orderby’ => ( (bool) $islemag_header_slider_random == false ? ‚date’ : ‚rand’ ),
  30. ‚order’ => ‚DESC’,
  31. ‚post_status’ => ‚publish’,
  32. ‚category_name’ => ( ! empty( $islemag_header_slider_category ) && $islemag_header_slider_category != ‚all’ ? $islemag_header_slider_category : ” ),
  33. )
  34. );
  35.  
  36. if ( (bool) $islemag_header_slider_disable !== true ) {
  37. if ( $wp_query->have_posts() ) { ?>
  38.  
  39. <div class=”islemag-top-container”>
  40. <div class=”owl-carousel islemag-top-carousel rect-dots”>
  41. <?php
  42. while ( $wp_query->have_posts() ) :
  43. $wp_query->the_post();
  44. get_template_part( ‚template-parts/slider-posts’, get_post_format() );
  45. endwhile;
  46. ?>
  47. </div><!– End .islemag-top-carousel –>
  48. </div><!– End .islemag-top-container –>
  49.  
  50. <?php
  51. } else {
  52. get_template_part( ‚template-parts/content’, ‚none’ );
  53. }
  54. wp_reset_postdata();
  55. }
  56. ?>
  57.  
  58. <div class=”container”>
  59. <div class=”row”>
  60.  
  61. <?php
  62. $archive_content_classes = apply_filters( ‚islemag_archive_content_classes’, array( ‚islemag-content-left’, ‚col-md-9’ ) );
  63. ?>
  64. <div
  65. <?php
  66. if ( ! empty( $archive_content_classes ) ) {
  67. echo ‚class=”‚ . implode( ‚ ‚, $archive_content_classes ) . ‚”‚; }
  68. ?>
  69. >
  70. <?php
  71.  
  72. /* ———Section 1——— */
  73. if ( ! $islemag_section1_fullwidth && ! $islemag_section1_disable ) {
  74. islemag_display_section( 1 );
  75. }
  76.  
  77. /* ———Section 2——— */
  78. if ( ! $islemag_section2_fullwidth && ! $islemag_section2_disable ) {
  79. islemag_display_section( 2 );
  80. }
  81.  
  82. /* ———Section 3——— */
  83. if ( ! $islemag_section3_fullwidth && ! $islemag_section3_disable ) {
  84. islemag_display_section( 3 );
  85. }
  86.  
  87. /* ———Section 4——— */
  88. if ( ! $islemag_section4_fullwidth && ! $islemag_section4_disable ) {
  89. islemag_display_section( 4 );
  90. }
  91.  
  92. /* ———Section 5——— */
  93. if ( ! $islemag_section5_fullwidth && ! $islemag_section5_disable ) {
  94. islemag_display_section( 5 );
  95. }
  96. ?>
  97.  
  98. </div><!– End .islemag-content-left –>
  99.  
  100. <?php
  101. get_sidebar();
  102. ?>
  103.  
  104. <?php
  105. if ( $islemag_section1_fullwidth == true ||
  106. $islemag_section2_fullwidth == true ||
  107. $islemag_section3_fullwidth == true ||
  108. $islemag_section4_fullwidth == true ||
  109. $islemag_section5_fullwidth == true ) {
  110. ?>
  111.  
  112. <div class=”col-md-12 islemag-fullwidth”>
  113. <?php
  114. /* ———Section 1——— */
  115. if ( $islemag_section1_fullwidth && ! $islemag_section1_disable ) {
  116. islemag_display_section( 1 );
  117. }
  118.  
  119. /* ———Section 2——— */
  120. if ( $islemag_section2_fullwidth && ! $islemag_section2_disable ) {
  121. islemag_display_section( 2 );
  122. }
  123.  
  124. /* ———Section 3——— */
  125. if ( $islemag_section3_fullwidth && ! $islemag_section3_disable ) {
  126. islemag_display_section( 3 );
  127. }
  128.  
  129. /* ———Section 4——— */
  130. if ( $islemag_section4_fullwidth && ! $islemag_section4_disable ) {
  131. islemag_display_section( 4 );
  132. }
  133.  
  134. /* ———Section 5——— */
  135. if ( $islemag_section5_fullwidth && ! $islemag_section5_disable ) {
  136. islemag_display_section( 5 );
  137. }
  138. ?>
  139. </div>
  140. <?php
  141. } else {
  142. if ( is_customize_preview() ) {
  143. echo ‚<div class=”col-md-12 islemag-fullwidth”></div>’;
  144. }
  145. }// End if().
  146. ?>
  147. </div><!– End .row –>
  148. </div><!– End .container –>
  149. <?php
  150. get_footer();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement