Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <section id="toplevel-frontpage">
- <div class="container">
- <div class="block">
- <div class="row">
- <div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
- <form id="lets_search" action="" style="width:400px;margin:0 auto;text-align:left;">
- Search:<input type="text" name="str" id="str">
- <input type="submit" value="send" id="send">
- </form>
- <div id="search_results"></div>
- </div>
- </div>
- </div>
- </div>
- </section>
- $(function() {
- $("#lets_search").bind('submit',function() {
- var value = $('#str').val();
- $.post('wp-content/themes/MyTheme/includes/search-post-results.php',{value:value}, function(data){
- $("#search_results").html(data);
- });
- return false;
- });
- });
- <?php session_start(); ?>
- <?php
- /*
- Template Name: Search Page
- */
- ?>
- <?php
- $value = $_POST['value'];
- $path = $_SERVER['DOCUMENT_ROOT'];
- include_once $path . '/wp-config.php';
- include_once $path . '/wp-load.php';
- include_once $path . '/wp-includes/wp-db.php';
- include_once $path . '/wp-includes/pluggable.php';
- ?>
- <?php
- $s=$_POST['value'];
- $args = array(
- 'post_type' => 'team',
- 'orderby' => 'title',
- 'order' => 'ASC',
- 'posts_per_page' => -1,
- 's' =>$s
- );
- // The Query
- $the_query = new WP_Query($args);
- if ( $the_query->have_posts() ) {
- while ( $the_query->have_posts() ) {
- $the_query->the_post();
- $value = get_the_id();
- $mail = get_field('e-mail_adres', $value);
- $afd = get_field('functie', $value);
- $intrn = get_field('intern_telefoonnummer', $value);
- $mob = get_field('mobiel', $value);
- $locatie = get_field('locatie', $value);
- ?>
- <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
- <div style="min-height:150px;">
- <div class="col-xs-12">
- <h3><?php the_title(); ?></h3>
- </div>
- <div class="col-xs-12 col-sm-12 col-md-2 col-lg-2">
- <div class="thumbnail-image">
- <?php echo get_the_post_thumbnail(); ?>
- </div>
- </div>
- <div class="col-xs-12 col-sm-12 col-md-10 col-lg-10">
- <div class="row">
- <table class="zoek-col">
- <?php if( get_field('intern_telefoonnummer') ): ?>
- <tr>
- <td class="td-top">Tel. Intern:</td>
- <td><?php the_field('intern_telefoonnummer'); ?></td>
- </tr>
- <?php endif; ?>
- <?php if( get_field('intern_utr') ): ?>
- <tr>
- <td class="td-top">Tel. Intern (extra):</td>
- <td><?php the_field('intern_utr'); ?></td>
- </tr>
- <?php endif; ?>
- <tr>
- <td class="td-top">E-mail adres:</td>
- <td><a href="mailto:<?php echo $mail; ?>"><?php echo $mail; ?></a></td>
- </tr>
- <?php if( get_field('mobiel_werk') ): ?>
- <tr>
- <td class="td-top">Mobiel werk:</td>
- <td><?php the_field('mobiel_werk'); ?></td>
- </tr>
- <?php endif; ?>
- <tr>
- <td class="td-top">Mobiel privé:</td>
- <td><?php echo $mob; ?></td>
- </tr>
- <?php if( get_field('locatie') ): ?>
- <tr>
- <td class="td-top">Locatie:</td>
- <td><?php the_field('locatie'); ?></td>
- </tr>
- <?php endif; ?>
- </table>
- </div>
- </div>
- </div>
- </div>
- <?php
- }
- }else{
- ?>
- <h3>Geen collega's gevonden</h3>
- <p style="font-size:1.3rem;">Probeer het opnieuw</p>
- <?php } ?>
- // include_once $path . '/wp-load.php';
- // include_once $path . '/wp-includes/wp-db.php';
- // include_once $path . '/wp-includes/pluggable.php';
Add Comment
Please, Sign In to add comment