Guest User

Untitled

a guest
Apr 24th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.10 KB | None | 0 0
  1. <section id="toplevel-frontpage">
  2. <div class="container">
  3. <div class="block">
  4. <div class="row">
  5. <div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
  6. <form id="lets_search" action="" style="width:400px;margin:0 auto;text-align:left;">
  7. Search:<input type="text" name="str" id="str">
  8. <input type="submit" value="send" id="send">
  9. </form>
  10. <div id="search_results"></div>
  11. </div>
  12. </div>
  13. </div>
  14. </div>
  15. </section>
  16.  
  17. $(function() {
  18. $("#lets_search").bind('submit',function() {
  19. var value = $('#str').val();
  20. $.post('wp-content/themes/MyTheme/includes/search-post-results.php',{value:value}, function(data){
  21. $("#search_results").html(data);
  22. });
  23. return false;
  24. });
  25. });
  26.  
  27. <?php session_start(); ?>
  28. <?php
  29. /*
  30. Template Name: Search Page
  31. */
  32. ?>
  33. <?php
  34. $value = $_POST['value'];
  35. $path = $_SERVER['DOCUMENT_ROOT'];
  36.  
  37. include_once $path . '/wp-config.php';
  38. include_once $path . '/wp-load.php';
  39. include_once $path . '/wp-includes/wp-db.php';
  40. include_once $path . '/wp-includes/pluggable.php';
  41.  
  42. ?>
  43. <?php
  44. $s=$_POST['value'];
  45. $args = array(
  46. 'post_type' => 'team',
  47. 'orderby' => 'title',
  48. 'order' => 'ASC',
  49. 'posts_per_page' => -1,
  50. 's' =>$s
  51. );
  52. // The Query
  53. $the_query = new WP_Query($args);
  54. if ( $the_query->have_posts() ) {
  55. while ( $the_query->have_posts() ) {
  56. $the_query->the_post();
  57. $value = get_the_id();
  58. $mail = get_field('e-mail_adres', $value);
  59. $afd = get_field('functie', $value);
  60. $intrn = get_field('intern_telefoonnummer', $value);
  61. $mob = get_field('mobiel', $value);
  62. $locatie = get_field('locatie', $value);
  63.  
  64.  
  65. ?>
  66.  
  67. <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
  68. <div style="min-height:150px;">
  69. <div class="col-xs-12">
  70. <h3><?php the_title(); ?></h3>
  71. </div>
  72. <div class="col-xs-12 col-sm-12 col-md-2 col-lg-2">
  73. <div class="thumbnail-image">
  74. <?php echo get_the_post_thumbnail(); ?>
  75. </div>
  76. </div>
  77. <div class="col-xs-12 col-sm-12 col-md-10 col-lg-10">
  78. <div class="row">
  79. <table class="zoek-col">
  80. <?php if( get_field('intern_telefoonnummer') ): ?>
  81. <tr>
  82. <td class="td-top">Tel. Intern:</td>
  83. <td><?php the_field('intern_telefoonnummer'); ?></td>
  84. </tr>
  85. <?php endif; ?>
  86. <?php if( get_field('intern_utr') ): ?>
  87. <tr>
  88. <td class="td-top">Tel. Intern (extra):</td>
  89. <td><?php the_field('intern_utr'); ?></td>
  90. </tr>
  91. <?php endif; ?>
  92. <tr>
  93. <td class="td-top">E-mail adres:</td>
  94. <td><a href="mailto:<?php echo $mail; ?>"><?php echo $mail; ?></a></td>
  95. </tr>
  96. <?php if( get_field('mobiel_werk') ): ?>
  97. <tr>
  98. <td class="td-top">Mobiel werk:</td>
  99. <td><?php the_field('mobiel_werk'); ?></td>
  100. </tr>
  101. <?php endif; ?>
  102. <tr>
  103. <td class="td-top">Mobiel privé:</td>
  104. <td><?php echo $mob; ?></td>
  105. </tr>
  106. <?php if( get_field('locatie') ): ?>
  107. <tr>
  108. <td class="td-top">Locatie:</td>
  109. <td><?php the_field('locatie'); ?></td>
  110. </tr>
  111. <?php endif; ?>
  112. </table>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. <?php
  118. }
  119. }else{
  120. ?>
  121. <h3>Geen collega's gevonden</h3>
  122. <p style="font-size:1.3rem;">Probeer het opnieuw</p>
  123. <?php } ?>
  124.  
  125. // include_once $path . '/wp-load.php';
  126. // include_once $path . '/wp-includes/wp-db.php';
  127. // include_once $path . '/wp-includes/pluggable.php';
Add Comment
Please, Sign In to add comment