Forum Replies Created

  • Thanks so much John! I got everything working right. I really appreciate the help.

  • Thanks John, I got the array working with the query and verified by replacing the variable with set values. It did in fact return the correct salesperson. But now I’m on to my other question which was how to pass the variable from basic select boxes in a form to the query and output the results. Below is the working query.

    // WP_Query arguments
    $args = array(
      'post_type' => 'sales_locator',
      'meta_query' => array(
        'relation' => 'AND',
          'key' => 'sl_country',
          'value' => '"'.$country.'"',
          'compare' => 'LIKE'
          'key' => 'sl_state',
          'value' => '"'.$state.'"',
          'compare' => 'LIKE'
          'key' => 'sl_industry',
          'value' => '"'.$industry.'"',
          'compare' => 'LIKE'
    // query
    $the_query = new WP_Query( $args );
    <?php if( $the_query->have_posts() ): ?>
    	<?php while( $the_query->have_posts() ) : $the_query->the_post(); ?>
    			<h1><?php the_field('sl_name'); ?></h1>
    			<?php the_content(); ?>
    	<?php endwhile; ?>
    <?php endif; ?>
    <?php wp_reset_query();	 // Restore global post data stomped by the_post(). ?>
  • I’m storing the salesperson name as a text field and all other information as setup as checkboxes on the back end. I’m really new to this plugin and I’m struggling with getting this to work

Viewing 3 posts - 1 through 3 (of 3 total)