PageRenderTime 43ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/Mobile/archive-contact_persons.php

https://gitlab.com/zohaibsaleem/dev
PHP | 237 lines | 136 code | 91 blank | 10 comment | 3 complexity | dc5e88404f3f841a44b28eca5fde7333 MD5 | raw file
  1. <?php get_header(); ?>
  2. <style type="text/css">
  3. #filters-select
  4. {
  5. display: none;
  6. }
  7. @media (max-width: 960px)
  8. {
  9. .container>#filters { display: none !important; }
  10. #filters-select { display: inline-block; }
  11. }
  12. </style>
  13. <!-- start content container -->
  14. <div class="dmbs-content">
  15. <div class="page-title title-1">
  16. <div class="container">
  17. <h1>Ansprechpartner</h1>
  18. <h3></h3>
  19. </div>
  20. </div>
  21. <div class="section">
  22. <div class="container">
  23. <ul id="filters">
  24. <li class="active shape">
  25. <a href="#" class="filter active" data-filter="*">Alle</a>
  26. </li>
  27. <li class="shape">
  28. <a href="#" class="filter" data-filter=".department-allgemeine-informationen">Allgemein</a>
  29. </li>
  30. <!--<li class="shape"><a href="#" class="filter" data-filter=".department-bankverbindung">Bankverbindung</a></li>-->
  31. <li class="shape"><a href="#" class="filter" data-filter=".department-praesidium">Präsidium</a></li>
  32. <li class="shape"><a href="#" class="filter" data-filter=".department-geschaeftsstelle">Geschäftsstelle</a></li>
  33. <li class="shape"><a href="#" class="filter" data-filter=".department-zuchtkommission">Zuchtkommision</a></li>
  34. <li class="shape"><a href="#" class="filter" data-filter=".department-zuchtbuchamt">Zuchtbuchamt</a></li>
  35. <li class="shape"><a href="#" class="filter" data-filter=".department-tierschutz">Tierschutz</a></li>
  36. <li class="shape"><a href="#" class="filter" data-filter=".department-regionalzuchtwarte">Regionalzuchtwarte</a></li>
  37. <li class="shape"><a href="#" class="filter" data-filter=".department-zuchtausschuss">Zuchtausschuss</a></li>
  38. <li class="shape"><a href="#" class="filter" data-filter=".department-vermittlungen">Vermittlungen</a></li>
  39. <li class="shape"><a href="#" class="filter" data-filter=".department-cn-redaktion">CN-Redaktion</a></li>
  40. <li class="shape"><a href="#" class="filter" data-filter=".department-internet">Internet</a></li>
  41. <li class="shape"><a href="#" class="filter" data-filter=".department-sport-hund">Sport&Hund</a></li>
  42. <li class="shape"><a href="#" class="filter" data-filter=".department-ausstellungswesen">Ausstellungswesen</a></li>
  43. <li class="shape"><a href="#" class="filter" data-filter=".department-klubartikel-shop">Klubartikel-Shop</a></li>
  44. <li class="shape"><a href="#" class="filter" data-filter=".department-landesgruppen">Landesgruppen</a></li>
  45. </ul>
  46. <style type="text/css">
  47. option:checked
  48. {
  49. background: #A6B181;
  50. color:white;
  51. }
  52. option
  53. {
  54. color: #A6B181;
  55. font-weight: bold;
  56. }
  57. </style>
  58. <select id="filters-select" >
  59. <option class="filter active" value="*" data-filter="*">Alle</option>
  60. <option class="filter" value=".department-allgemeine-informationen" data-filter=".department-allgemeine-informationen">
  61. Allgemein
  62. </option>
  63. <option class="filter" value=".department-praesidium" data-filter=".department-praesidium">
  64. Präsidium
  65. </option>
  66. <option class="filter " value=".department-geschaeftsstelle" data-filter=".department-geschaeftsstelle">Geschäftsstelle</option>
  67. <option class="filter" value=".department-zuchtkommission" data-filter".department-zuchtkommission">Zuchtkommision</option>
  68. <option class="filter" value=".department-zuchtbuchamt" data-filter".department-zuchtbuchamt">Zuchtbuchamt</option>
  69. <option class="filter" value=".department-tierschutz" data-filter".department-tierschutz">Tierschutz</option>
  70. <option class="filter" value=".department-regionalzuchtwarte" data-filter".department-regionalzuchtwarte">Regionalzuchtwarte</option>
  71. <option class="filter" value=".department-zuchtausschuss" data-filter".department-zuchtausschuss">Zuchtausschuss</option>
  72. <option class="filter" value=".department-vermittlungen" data-filter".department-vermittlungen">Vermittlungen</option>
  73. <option class="filter" value=".department-cn-redaktion" data-filter".department-cn-redaktion">CN-Redaktion</option>
  74. <option class="filter" value=".department-internet" data-filter".department-internet">Internet</option>
  75. <option class="filter" value=".department-sport-hund" data-filter".department-sport-hund">Sport&Hund</option>
  76. <option class="filter" value=".department-ausstellungswesen" data-filter".department-ausstellungswesen">Ausstellungswesen</option>
  77. <option class="filter" value=".department-klubartikel-shop" data-filter".department-klubartikel-shop">Klubartikel-Shop</option>
  78. <option class="filter" value=".department-landesgruppen" data-filter".department-landesgruppen">Landesgruppen</option>
  79. </select>
  80. <?php //start by fetching the terms for the varietaet taxonomy
  81. $terms = get_terms( 'department', array(
  82. //'orderby' => 'date',
  83. 'order' => 'ASC',
  84. 'hide_empty' => 0
  85. ) );
  86. ?>
  87. <div id="grid" >
  88. <?php
  89. // now run a query for each
  90. foreach( $terms as $term ) {}
  91. // Define the query
  92. $args = array(
  93. 'post_type' => 'contact_persons',
  94. //'department' => $term->slug,
  95. //'meta_key' => 'rude_wurftag_datum',
  96. // 'orderby' => 'meta_value',
  97. 'order' => 'ASC'
  98. );
  99. $query = new WP_Query( $args );
  100. // Start the Loop
  101. while ( $query->have_posts() ) : $query->the_post(); ?>
  102. <?php $do_not_duplicate = $post->ID; ?>
  103. <div <?php post_class('element-item col-sm-6 col-md-4 '); ?> data-category="transition">
  104. <div class="thumbnail contact-persons contact-persons3">
  105. <div class="caption">
  106. <?php $terms = wp_get_post_terms( $post->ID, 'department', array("fields" => "names") );
  107. echo '<span>' .implode(', ',$terms). '</span>' ?>
  108. <div class="thumb_card_header">
  109. <?php if(get_field('contact_person_image')){?>
  110. <div class="content-1-3">
  111. <?php $image = get_field('contact_person_image');?>
  112. <img height="100px" class="image-responsive" src="<?php echo $image['sizes']['thumbnail']; ?>" alt="<?php echo $image['alt']; ?>" />
  113. </div>
  114. <div class="content-2-3">
  115. <?php the_field('contact_person_address'); ?>
  116. </div>
  117. <?php }else{?>
  118. <div class="content-1-1">
  119. <?php the_field('contact_person_address'); ?>
  120. </div>
  121. <?php } ?>
  122. </div>
  123. <div class="thumb_card_content clearfix">
  124. <div class="content-1-1">
  125. <?php if(get_field('contact_person_mail')){?>
  126. <span class="pull-right"><a href="mailto:<?php the_field('contact_person_mail'); ?>">E-Mail</a></span>
  127. <?php }?>
  128. <h2 class="card-header"><?php the_title() ;?></h2>
  129. <h3 class="card-subheader"><?php the_field('funktion_amt_position'); ?></h3>
  130. </div>
  131. </div><!-- thumb_card_content -->
  132. </div>
  133. </div> <!-- thumbnail -->
  134. </div> <!-- element-item -->
  135. <?php endwhile;?>
  136. <?php
  137. // use reset postdata to restore orginal query
  138. wp_reset_postdata();
  139. ?>
  140. </div>
  141. </div>
  142. </div>
  143. <?php echo get_num_queries(); ?>
  144. </div>
  145. <!-- end content container -->
  146. <?php get_footer(); ?>