Advertisement
Guest User

Untitled

a guest
Sep 29th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.70 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  
  5. * The template for displaying archive pages.
  6.  
  7. *
  8.  
  9. * Learn more: http://codex.wordpress.org/Template_Hierarchy
  10.  
  11. *
  12.  
  13. * @package faccin
  14.  
  15. */
  16.  
  17.  
  18.  
  19. get_header(); ?>
  20.  
  21.  
  22.  
  23. <?php global $wp_query; ?>
  24.  
  25. </div> <!-- /. container -->
  26.  
  27. <div id="primary" class="content-area">
  28.  
  29. <main id="main" class="site-main clearfix" role="main">
  30.  
  31.  
  32.  
  33. <div class="container">
  34.  
  35. <?php
  36.  
  37.  
  38.  
  39. if (function_exists('yoast_breadcrumb')) {
  40.  
  41. yoast_breadcrumb('<p id="breadcrumbs">', '</p>');
  42.  
  43. }
  44.  
  45. ?>
  46.  
  47. <?php if( is_user_logged_in() ) : ?>
  48.  
  49.  
  50.  
  51. <div class="rows full-width">
  52.  
  53. <div class="col-md-12 col-sm-12 grey-background taxonomy-wrapper">
  54.  
  55. <h3><?php the_field('categorie_label', 'option'); ?></h3>
  56.  
  57. <?php
  58.  
  59.  
  60.  
  61. $taxonomy = 'case_studies';
  62.  
  63. $terms = get_terms($taxonomy ,array( 'hide_empty' => false)); // Get all terms of a taxonomy
  64.  
  65. if ( $terms && !is_wp_error( $terms ) ) :
  66.  
  67. ?>
  68.  
  69. <ul class="category-names">
  70.  
  71. <?php foreach ( $terms as $term ) { ?>
  72.  
  73. <li class="single-category-name-wrapper col-md-2">
  74.  
  75. <span class="category-name">
  76.  
  77. <?php echo $term->name; ?>
  78.  
  79. </span>
  80.  
  81. <!-- <ul class="category-posts"> -->
  82.  
  83. <?php /*
  84.  
  85.  
  86.  
  87. $posts_studies = new WP_Query(
  88.  
  89. array(
  90.  
  91. 'post_type' => 'case_study',
  92.  
  93. 'posts_per_page' => -1,
  94.  
  95. 'tax_query' => array(
  96.  
  97. array(
  98.  
  99. 'taxonomy' => 'case_studies',
  100.  
  101. 'terms' => $term->term_id,
  102.  
  103. )
  104.  
  105. )
  106.  
  107. )
  108.  
  109. );
  110.  
  111.  
  112.  
  113. if( $posts_studies->have_posts() ){
  114.  
  115. while( $posts_studies->have_posts() ){
  116.  
  117. $posts_studies->the_post();
  118.  
  119. ?>
  120.  
  121.  
  122.  
  123. <li class="single-category-post-name">
  124.  
  125. <a href="<?php the_permalink(); ?>">
  126.  
  127. <?php the_title(); ?>
  128.  
  129. </a>
  130.  
  131. </li>
  132.  
  133.  
  134.  
  135. <?php
  136.  
  137. }
  138.  
  139. }
  140.  
  141.  
  142.  
  143. */
  144.  
  145. ?>
  146.  
  147.  
  148.  
  149. <!-- </ul> -->
  150.  
  151. </li>
  152.  
  153. <?php } ?>
  154.  
  155. </ul>
  156.  
  157. <?php endif;?>
  158.  
  159.  
  160.  
  161. </div>
  162.  
  163. <div class="col-md-8 col-sm-8 pull-right taxonomy-image-wrap">
  164.  
  165. <div class="taxonomy-image-wrap-inner">
  166.  
  167. <h2 class="text-left content-title"><?php the_field('case_study_label', 'option'); ?></h2>
  168.  
  169. <div class="posts-right-archive">
  170.  
  171. <ul class="category-posts">
  172.  
  173. <?php
  174.  
  175. $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
  176.  
  177.  
  178.  
  179. if( have_posts() ){
  180.  
  181. while( have_posts() ){
  182.  
  183. the_post();
  184.  
  185. ?>
  186.  
  187. <li class="single-study-wrapper clearfix">
  188.  
  189. <div class="study-thumbnail-wrapper col-md-3">
  190.  
  191. <a href="<?php the_permalink(); ?>">
  192.  
  193. <?php the_post_thumbnail('study_archive'); ?>
  194.  
  195. </a>
  196.  
  197. </div>
  198.  
  199. <div class="col-md-9 study-text-content-wrapper">
  200.  
  201. <h4 class="study-title">
  202.  
  203. <a href="<?php the_permalink(); ?>">
  204.  
  205. <?php the_title(); ?>
  206.  
  207. </a>
  208.  
  209. </h4>
  210.  
  211. <div class="study-excerpt">
  212.  
  213. <?php the_excerpt(); ?>
  214.  
  215. </div>
  216.  
  217. <div class="study-read-more">
  218.  
  219. <a href="<?php the_permalink(); ?>"><?php the_field('see_more', 'option'); ?></a>
  220.  
  221. <div class="download-circle">
  222.  
  223. <i class="fa fa-long-arrow-right" aria-hidden="true"></i>|
  224.  
  225. </div>
  226.  
  227. </div>
  228.  
  229. </div>
  230.  
  231. </li>
  232.  
  233.  
  234.  
  235. <?php
  236.  
  237. }
  238.  
  239. //
  240.  
  241. $big = 999999999; // need an unlikely integer
  242.  
  243.  
  244.  
  245. echo paginate_links( array(
  246.  
  247. 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
  248.  
  249. 'format' => '?paged=%#%',
  250.  
  251. 'current' => max( 1, get_query_var('paged') ),
  252.  
  253. 'total' => $wp_query->max_num_pages,
  254.  
  255. 'prev_text' => __('«'),
  256.  
  257. 'next_text' => __('»'),
  258.  
  259. ) );
  260.  
  261. }
  262.  
  263. ?>
  264.  
  265.  
  266.  
  267. </ul>
  268.  
  269. </div>
  270.  
  271. </div>
  272.  
  273. </div>
  274.  
  275. </div>
  276.  
  277. <?php else : ?>
  278.  
  279. <script>
  280.  
  281. window.location.href= "<?php echo the_permalink(272); ?>";
  282.  
  283. </script>
  284.  
  285. <?php endif; ?>
  286.  
  287.  
  288.  
  289. </div>
  290.  
  291.  
  292.  
  293. </main><!-- #main -->
  294.  
  295. </div><!-- #primary -->
  296.  
  297.  
  298.  
  299.  
  300.  
  301. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement