예제 #1
0
/**
 * Constructs JSON-formatted response object for AJAX requests
 *
 * @param array $post
 * @return mixed|string|void
 */
function wpas_build_ajax_response(array $post)
{
    $request = array();
    if (isset($post['form_data'])) {
        parse_str($post['form_data'], $request);
    }
    $page = isset($post['page']) ? $post['page'] : 0;
    $request['paged'] = $page;
    $wpas_id = $request['wpas_id'];
    $wpas = new WP_Advanced_Search($wpas_id, $request);
    $q = $wpas->query();
    $template = $wpas->get_ajax()->resultsTemplate();
    $response = array();
    $response["results"] = wpas_load_template_part($template, $q);
    $response["current_page"] = $q->query_vars['paged'];
    $response["max_page"] = $q->max_num_pages;
    if ($response["results"] === false) {
        $wpas->set_error("AJAX results template '" . $template . "' not found in theme root.");
    }
    $response["debug"] = "";
    if ($wpas->debug_enabled()) {
        $response["debug"] = "<pre>" . $wpas->create_debug_output() . "</pre>";
    }
    return json_encode($response);
}
    echo '8';
}
?>
 <?php 
if ($sd_data['sd_sidebar_location'] == '2') {
    echo 'pull-right';
}
?>
">
				<div class="sd-left-col">
					<?php 
global $wp_query;
global $more;
$more = 0;
$args = sd_wp_advanced_search();
$sd_search_course = new WP_Advanced_Search($args);
$wp_query = $sd_search_course->query();
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>
						<?php 
        get_template_part('framework/inc/post-formats/courses/content', get_post_format());
        ?>
						<?php 
    }
} else {
    ?>
					<p>
						<?php 
    _e('Sorry, no results matched your criteria', 'sd-framework');
the_title();
?>
</h1>

		<?php 
$args = array();
$args['wp_query'] = array('post_type' => 'post', 'posts_per_page' => 5, 'order' => 'DESC', 'orderby' => 'date');
$args['fields'][] = array('type' => 'search', 'label' => 'Search', 'value' => '');
$args['fields'][] = array('type' => 'post_type', 'label' => 'Post Type', 'values' => array('post' => 'Post', 'page' => 'Page'), 'format' => 'select');
$args['fields'][] = array('type' => 'taxonomy', 'label' => 'Category', 'taxonomy' => 'category', 'format' => 'multi-select', 'operator' => 'AND');
$args['fields'][] = array('type' => 'taxonomy', 'label' => 'Tags', 'taxonomy' => 'post_tag', 'format' => 'checkbox', 'operator' => 'IN');
$args['fields'][] = array('type' => 'date', 'label' => 'Month', 'date_type' => 'month', 'format' => 'multi-select');
$args['fields'][] = array('type' => 'orderby', 'label' => 'Order By', 'values' => array('' => '', 'ID' => 'ID', 'title' => 'Title', 'date' => 'Date'), 'format' => 'select');
$args['fields'][] = array('type' => 'order', 'label' => 'Order', 'values' => array('' => '', 'ASC' => 'ASC', 'DESC' => 'DESC'), 'format' => 'select');
$args['fields'][] = array('type' => 'submit', 'value' => 'Search');
$my_search_object = new WP_Advanced_Search($args);
$my_search_object->the_form();
$temp_query = $wp_query;
$wp_query = $my_search_object->query();
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>
					<h2><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h2>
					<p><strong>Author:</strong> <?php 
예제 #4
0
$args['wp_query'] = array('post_type' => 'rotary_speakers', 'posts_per_page' => -1, 'orderby' => 'meta_value', 'meta_key' => 'speaker_date');
$args['fields'][] = array('type' => 'meta_key', 'format' => 'text', 'default' => '', 'compare' => 'LIKE', 'label' => 'First Name', 'meta_key' => 'speaker_first_name');
$args['fields'][] = array('type' => 'meta_key', 'format' => 'text', 'compare' => 'LIKE', 'label' => 'Last Name', 'meta_key' => 'speaker_last_name');
$args['fields'][] = array('type' => 'meta_key', 'format' => 'text', 'compare' => 'LIKE', 'label' => 'Organization', 'meta_key' => 'speaker_company');
$args['fields'][] = array('type' => 'meta_key', 'format' => 'text', 'label' => 'Job Title/Position', 'compare' => 'LIKE', 'meta_key' => 'speaker_title');
$args['fields'][] = array('type' => 'taxonomy', 'label' => 'Category', 'format' => 'select', 'allow_null' => 'Select a Category', 'taxonomy' => 'rotary_speaker_cat');
$args['fields'][] = array('type' => 'taxonomy', 'label' => 'Tag(s)', 'format' => 'select', 'allow_null' => 'Select a Tag', 'taxonomy' => 'rotary_speaker_tag');
$args['fields'][] = array('type' => 'meta_key', 'format' => 'text', 'label' => 'About the Speaker', 'compare' => 'IN', 'meta_key' => 'speaker_bio');
$args['fields'][] = array('type' => 'meta_key', 'format' => 'date', 'label' => 'Speaker Dates', 'compare' => '>=', 'data_type' => 'DATE', 'placeholder' => 'mm/dd/yyyy', 'meta_key' => 'speaker_date_from', 'sublabel' => 'From');
$args['fields'][] = array('type' => 'meta_key', 'format' => 'date', 'label' => '&nbsp;', 'sublabel' => 'To', 'compare' => '<=', 'data_type' => 'DATE', 'placeholder' => 'mm/dd/yyyy', 'meta_key' => 'speaker_date_to');
$args['fields'][] = array('type' => 'reset', 'value' => "Reset Filters");
$args['fields'][] = array('type' => 'submit', 'value' => 'Search');
$args['form'] = array('method' => 'POST');
//$args['relevanssi'] = true;
//instantiate search
$speaker_search = new WP_Advanced_Search($args);
?>
<h1 class="pagetitle"><span>Speaker Program</span></h1>
<div id="speakertabs" class="speakertabs">

<div id="tabs-1">
<?php 
//show the form
?>
<a id="search-toggle" href="#" class="search-toggle collapsed">Advanced Search</a>
<?php 
$speaker_search->the_form();
$query = new WP_Query();
$query = $speaker_search->query();
?>
예제 #5
0
파일: header.php 프로젝트: RCMmedia/kuopp
/images/social-icon-linkedin.png" ></a>
				<a href="" target="_blank"><img src="<?php 
bloginfo('template_url');
?>
/images/social-icon-gplus.png" ></a>
			</div><!-- .social-icons -->
		</div><!-- .main-navigation-wrap -->
		
		<?php 
if (is_singular('project') || is_page_template('page-templates/page-projects.php')) {
    ?>
			
			<h3>Search:</h3>
			
			<?php 
    $my_search = new WP_Advanced_Search('my-form');
    $my_search->the_form();
    ?>
			
		<?php 
}
?>
	
		<script>
			jQuery(".show-main-navigation").click(function(){
				jQuery(".main-navigation-wrap").slideToggle();
			});
			$('#mobile-menu-icon').click(function(){
				$(this).toggleClass('open');
				$(".sidebar").toggleClass("mobile-loaded")
			});
예제 #6
0
<?php

/*Template Name: Search */
get_header();
?>

<?php 
if (is_user_logged_in()) {
    ?>

<div class="inner cover">
  <div class="projects-wrapper clearfix">

<?php 
    $my_search = new WP_Advanced_Search('my-form');
    $query = $my_search->query();
    ?>

  <?php 
    if ($query->have_posts()) {
        ?>
    <ul>
    <?php 
        while ($query->have_posts()) {
            $query->the_post();
            ?>
      <?php 
            $status = get_field('completed');
            ?>
      <li class="project">
        <a href="<?php 
예제 #7
0
<div class="sd-search-courses clearfix">
	<div class="container">
		<h2><?php 
_e('Search Courses', 'sd-framework');
?>
</h2>
    	
		<?php 
$args = sd_wp_advanced_search();
$sd_search_course = new WP_Advanced_Search($args);
$sd_search_course->the_form();
?>
    
    </div>
</div>
예제 #8
0

			<div id="content">

				<div id="inner-content" class="clearfix">

                  <div id="search-page" class="large-12 columns" role="main">
                   <h1 class="page-title"><?php 
echo 'Findings';
?>
</h1>


                   <div class="archive-findings large-8 medium-8 columns">
                   <?php 
$my_search = new WP_Advanced_Search($args);
$temp_query = $wp_query;
$wp_query = $my_search->query();
?>

                   <?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>

                   <?php 
        get_template_part('partials/loop', 'findings-search');
        ?>

                   <?php