Support

Account

Home Forums Add-ons Repeater Field Search engine with repeater field and wp_query Reply To: Search engine with repeater field and wp_query

  • There will be around 2000 “Programmes” in the DB…

    I’ve found another way to do it. Maybe not the best way or the cleanest but hey, it works !

    <?php foreach($produits->posts as $id):?>
       <?php if( have_rows('prix',$id)): ?>
    
          <?php /*If Typology AND Price are selected in the search engine */ ?>
          <?php while( have_rows('prix',$id) ) : the_row();?>
              <?php if((!empty($_POST['typologie']) && $_POST['typologie'] == get_sub_field('typo_prog')) && (!empty($_POST['prix']) && $_POST['prix'] > get_sub_field('prix_prog'))):?>
    
                     <a href="<?php the_permalink($id);?>" class="produit col-md-4">
                        MY CONTENT
                     </a> 
               <?php endif;?>
            <?php endwhile;?>
    
       <?php /*If Typology or price are NOT selected in the search engine */ ?>
        <?php if(empty($_POST['typologie']) || empty($_POST['prix'])):?>
    
           <a href="<?php the_permalink($id);?>" class="produit col-md-4">
              MY CONTENT
           </a>
        <?php endif;?>
    
      <?php  endif;?>
    <?php endforeach;?>