No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 
 

194 líneas
7.0 KiB

  1. <?php
  2. /**
  3. * Template Name: Team
  4. *
  5. * Page template with normal content area including an events section after the post.
  6. *
  7. */
  8. get_header() ?>
  9. <?php the_post() ?>
  10. <section id="content" class="articles wrapper container">
  11. <header id="post-<?php the_ID(); ?>" <?php post_class('section-header'); ?>>
  12. <h1 class="title"><?php the_title() ?></h1>
  13. <div class="intro content">
  14. <?php the_content() ?>
  15. </div>
  16. </header>
  17. <?php
  18. /*
  19. * @Sidebar Content before
  20. */
  21. get_sidebar('content-before'); ?>
  22. <div class="inner">
  23. <?php
  24. /**
  25. * Team members with "_on_top" option
  26. * ordered by menu_order *
  27. */
  28. $team_on_top_options = array(
  29. 'post_type' => 'team',
  30. 'meta_query' => array(
  31. array(
  32. 'key' => '_on_top',
  33. 'value' => 1,
  34. 'compare' => 'LIKE',
  35. ),
  36. ),
  37. 'posts_per_page' => -1,
  38. 'orderby' => 'menu_order',
  39. 'order' => 'ASC',
  40. );
  41. $team_on_top_query = new WP_Query($team_on_top_options);
  42. ?>
  43. <?php if ( $team_on_top_query->have_posts() ) { ?>
  44. <?php while ( $team_on_top_query->have_posts() ) {
  45. $team_on_top_query->the_post(); ?>
  46. <?php
  47. $post_id = get_the_ID();
  48. $post_type = get_post_type($post_id);
  49. $post_meta = sandbox_get_post_meta($post_id);
  50. if ( !isset($post_meta['_hide']) || !filter_var($post_meta['_hide'], FILTER_VALIDATE_BOOLEAN) ) {
  51. $excerpt = apply_filters('the_content', has_excerpt() ? get_the_excerpt() : get_the_content());
  52. $team_position = $post_meta['_team-position'];
  53. $team_phone = $post_meta['_team-phone'];
  54. $team_phone_display = sandbox_sanitize_phone($team_phone, true);
  55. $team_email = $post_meta['_team-email'];
  56. $team_linkedin = $post_meta['_team-linkedin'];
  57. // post thumbnail as background image
  58. $thumbnail_style = '';
  59. if ( has_post_thumbnail() ) {
  60. $thumbnail_style = ' style="background-image:url(' . get_the_post_thumbnail_url($post_id, 'semi-large') . ');"';
  61. }
  62. ?>
  63. <article id="post-<?php the_ID() ?>" <?php post_class(); ?>>
  64. <div class="inner">
  65. <?php if ( has_post_thumbnail() ) { ?>
  66. <span class="post-thumbnail"<?php echo $thumbnail_style; ?>><?php the_post_thumbnail('sandbox-default'); ?></span>
  67. <?php } ?>
  68. <div class="content">
  69. <h2><?php the_title() ?></h2>
  70. <?php if ( !empty($team_position) ) { ?>
  71. <p class="position"><strong><?php echo $team_position; ?></strong></p>
  72. <?php } ?>
  73. <?php if ( !empty($excerpt) ) { ?>
  74. <?php echo $excerpt; ?>
  75. <?php } ?>
  76. <ul class="contacts">
  77. <?php if ( !empty($team_phone) ) { ?>
  78. <li class="phone"><a href="tel:<?php echo $team_phone; ?>"><?php echo $team_phone_display; ?></a></li>
  79. <?php } ?>
  80. <?php if ( !empty($team_email) ) { ?>
  81. <li class="mail"><a href="mailto:<?php echo $team_email; ?>"><?php echo $team_email; ?></a></li>
  82. <?php } ?>
  83. <?php if ( !empty($team_linkedin) ) { ?>
  84. <li class="linkedin"><a href="<?php echo $team_linkedin; ?>" target="_blank" rel="noreferrer nofollow"><?php echo __('Get in touch', 'sandbox'); ?></a></li>
  85. <?php } ?>
  86. </ul>
  87. </div>
  88. </div>
  89. </article><!-- .post -->
  90. <?php } ?>
  91. <?php } ?>
  92. <?php wp_reset_postdata(); ?>
  93. <?php } ?>
  94. <?php
  95. /**
  96. * Team members without "_on_top" option
  97. * ordered by Name (title) *
  98. */
  99. $team_options = array(
  100. 'post_type' => 'team',
  101. 'order' => 'ASC',
  102. 'orderby' => 'title',
  103. 'posts_per_page' => 100,
  104. 'meta_query' => array(
  105. 'relation' => 'OR',
  106. array(
  107. 'key' => '_on_top',
  108. 'value' => 1,
  109. 'compare' => 'NOT LIKE',
  110. ),
  111. array(
  112. 'key' => '_on_top',
  113. 'value' => 'bug #23268',
  114. 'compare' => 'NOT EXISTS',
  115. )
  116. ),
  117. );
  118. $team_query = new WP_Query($team_options);
  119. ?>
  120. <?php if ( $team_query->have_posts() ) { ?>
  121. <?php while ( $team_query->have_posts() ) {
  122. $team_query->the_post(); ?>
  123. <?php
  124. $post_id = get_the_ID();
  125. $post_type = get_post_type($post_id);
  126. $post_meta = sandbox_get_post_meta($post_id);
  127. if ( !isset($post_meta['_hide']) || !filter_var($post_meta['_hide'], FILTER_VALIDATE_BOOLEAN) ) {
  128. $excerpt = apply_filters('the_content', has_excerpt() ? get_the_excerpt() : get_the_content());
  129. $team_position = $post_meta['_team-position'];
  130. $team_phone = $post_meta['_team-phone'];
  131. $team_phone_display = sandbox_sanitize_phone($team_phone, true);
  132. $team_email = $post_meta['_team-email'];
  133. $team_linkedin = $post_meta['_team-linkedin'];
  134. // post thumbnail as background image
  135. $thumbnail_style = '';
  136. if ( has_post_thumbnail() ) {
  137. $thumbnail_style = ' style="background-image:url(' . get_the_post_thumbnail_url($post_id, 'semi-large') . ');"';
  138. }
  139. ?>
  140. <article id="post-<?php the_ID() ?>" <?php post_class(); ?>>
  141. <div class="inner">
  142. <?php if ( has_post_thumbnail() ) { ?>
  143. <span class="post-thumbnail" <?php echo $thumbnail_style; ?>><?php the_post_thumbnail('sandbox-default'); ?></span>
  144. <?php } ?>
  145. <div class="content">
  146. <h2><?php the_title() ?></h2>
  147. <?php if ( !empty($team_position) ) { ?>
  148. <p class="position"><strong><?php echo $team_position; ?></strong></p>
  149. <?php } ?>
  150. <?php if ( !empty($excerpt) ) { ?>
  151. <?php echo $excerpt; ?>
  152. <?php } ?>
  153. <ul class="contacts">
  154. <?php if ( !empty($team_phone) ) { ?>
  155. <li class="phone"><a href="tel:<?php echo $team_phone; ?>"><?php echo $team_phone_display; ?></a></li>
  156. <?php } ?>
  157. <?php if ( !empty($team_email) ) { ?>
  158. <li class="mail"><a href="mailto:<?php echo $team_email; ?>"><?php echo $team_email; ?></a></li>
  159. <?php } ?>
  160. <?php if ( !empty($team_linkedin) ) { ?>
  161. <li class="linkedin"><a href="<?php echo $team_linkedin; ?>" target="_blank" rel="noreferrer nofollow"><?php echo __('Get in touch', 'sandbox'); ?></a></li>
  162. <?php } ?>
  163. </ul>
  164. </div>
  165. </div>
  166. </article><!-- .post -->
  167. <?php } ?>
  168. <?php } ?>
  169. <?php wp_reset_postdata(); ?>
  170. <?php } ?>
  171. </div>
  172. <?php
  173. /*
  174. * @Sidebar Content after
  175. */
  176. get_sidebar('content-after'); ?>
  177. </section>
  178. <?php get_footer() ?>