Advertisement
Guest User

Untitled

a guest
Jan 9th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.52 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3. <?php if( $fa = herald_get_featured_area() ) : ?>
  4. <?php if(!empty($fa['query']) && !empty( $fa['query']->posts ) ): ?>
  5. <?php $fa_query = $fa['query']; ?>
  6. <div class="herald-section container herald-no-sid">
  7. <div class="row">
  8. <div class="herald-module col-lg-12 col-md-12">
  9. <?php herald_set_img_flag('full'); ?>
  10. <?php include( locate_template('template-parts/featured/area-'. $fa['layout'].'.php' ) ); ?>
  11. <?php herald_set_img_flag(''); ?>
  12. </div>
  13. </div>
  14. </div>
  15. <?php endif; ?>
  16. <?php endif; ?>
  17.  
  18. <?php global $herald_sidebar_opts; ?>
  19. <?php $section_class = $herald_sidebar_opts['use_sidebar'] == 'none' ? 'herald-no-sid' : '' ?>
  20.  
  21. <div class="herald-section container <?php echo esc_attr($section_class); ?>">
  22. <div class="row">
  23. <?php if($herald_sidebar_opts['use_sidebar'] == 'left'): ?>
  24. <?php get_sidebar(); ?>
  25. <?php endif; ?>
  26.  
  27. <?php $wrap_class = $herald_sidebar_opts['use_sidebar'] != 'none' ? 'herald-main-content col-lg-9 col-md-9' : 'col-lg-12 col-md-12' ?>
  28.  
  29. <div class="herald-module col-mod-main <?php echo esc_attr($wrap_class); ?>">
  30. <br>
  31. <!-- Yandex.RTB R-A-238189-17 -->
  32. <div id="yandex_rtb_R-A-238189-17"></div>
  33. <script type="text/javascript">
  34. (function(w, d, n, s, t) {
  35. w[n] = w[n] || [];
  36. w[n].push(function() {
  37. Ya.Context.AdvManager.render({
  38. blockId: "R-A-238189-17",
  39. renderTo: "yandex_rtb_R-A-238189-17",
  40. async: true
  41. });
  42. });
  43. t = d.getElementsByTagName("script")[0];
  44. s = d.createElement("script");
  45. s.type = "text/javascript";
  46. s.src = "//an.yandex.ru/system/context.js";
  47. s.async = true;
  48. t.parentNode.insertBefore(s, t);
  49. })(this, this.document, "yandexContextAsyncCallbacks");
  50. </script>
  51. <div class="nav-single">
  52. <?php
  53. if ( function_exists('yoast_breadcrumb') ) {
  54. yoast_breadcrumb('
  55. <p id="breadcrumbs">','</p>
  56. ');
  57. }
  58. ?>
  59. </div>
  60.  
  61. <?php if ( $archive_heading = herald_get_archive_heading() ): ?>
  62. <?php echo $archive_heading; ?>
  63. <?php endif; ?>
  64.  
  65. <?php $ad_position = herald_get_option('ad_between_posts') ? absint( herald_get_option('ad_between_posts_position') - 1 ) : false ; ?>
  66. <div class="row row-eq-height herald-posts">
  67.  
  68. <?php
  69. $category = get_queried_object();
  70. $cat_id = $category->term_id;
  71. echo "<!-- $cat_id -->";
  72. $cat_level = count(get_ancestors($cat_id,'category')); // уровень категории от 0 до n
  73. $exclude_cats = array('2716','2631'); // Категории-исключения, где нужно видеть посты.
  74. // Если категория второго уровня (0,1,2..) и её номер не в исключениях, убрать посты. Костыль
  75. // if($cat_level==1 && !in_array($cat_id,$exclude_cats)){
  76. // query_posts('category_name=random63463646346363');
  77. // }
  78. // else{
  79. // Своя сортировка для некоторых категорий
  80. if($cat_id != 622 && $cat_id != 1229 && $cat_id != 620 && $cat_id != 1464 && $cat_id != 1230 ){
  81. query_posts($query_string.'&orderby=title&order=asc');
  82. }
  83. else{
  84. query_posts($query_string.'&orderby=date&order=desc');
  85. }
  86. // }
  87. ?>
  88. <?php if(have_posts()): ?>
  89. <?php $i = 0; while ( have_posts() ) : the_post(); ?>
  90. <?php ?>
  91. <?php get_template_part('template-parts/layouts/content', herald_get_current_post_layout( $i ) ); ?>
  92. <?php if( $i === $ad_position ) { get_template_part('template-parts/ads/between-posts'); } ?>
  93. <?php $i++; endwhile; ?>
  94. <?php else : ?>
  95. <?php get_template_part('template-parts/layouts/content-none' ); ?>
  96. <?php endif;?>
  97. </div>
  98.  
  99. <?php if( $pagination = herald_get_current_pagination() ) : ?>
  100. <?php get_template_part( 'template-parts/pagination/' . $pagination ); ?>
  101. <?php endif; ?>
  102. </div>
  103.  
  104. <?php if( $herald_sidebar_opts['use_sidebar'] == 'right' ): ?>
  105. <?php get_sidebar(); ?>
  106. <?php endif; ?>
  107.  
  108. </div>
  109.  
  110. <style>
  111. .txt-more { height:300px; margin:20px 0;}
  112. @media(min-width: 800px) { .txt-more { height:180px; margin: 0 0 40px 0;} }
  113. </style>
  114. <center>
  115. <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  116. <ins class="adsbygoogle txt-more"
  117. style="display:block"
  118. data-ad-client="ca-pub-3758637505510927"
  119. data-ad-slot="4929820333"
  120. data-ad-format="link"></ins>
  121. <script>
  122. (adsbygoogle = window.adsbygoogle || []).push({});
  123. </script>
  124. </center>
  125. </div>
  126.  
  127. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement