Home Forums General Issues Insert Cat ID into Query Reply To: Insert Cat ID into Query

  • I think we’re closer, but no cigar 🙁 but I’ve also moved on to wp-query. I have it set up, but it’s still not pulling the category for the query. Here is my complete loop:

      <?php if( have_rows('parts_table') ): ?>
        <?php while( have_rows('parts_table') ): the_row(); ?>    
    $catquery = new WP_Query( 'order=ASC&orderby=meta_value&meta_key=weight_(lbs.)&showposts=200&cat='.get_sub_field('part_category').'&post_type=sweeps' ); ?>
    <tr><td>Part Number</td><td>Description</td><td>Weight (lbs.)</td>
    <?php while($catquery->have_posts()) : $catquery->the_post();
                        <?php the_field('part_number'); ?>
                        <?php the_field('description'); ?>
                        <?php the_field('weight_(lbs.)'); ?>
    <?php endwhile; ?>
          <?php wp_reset_query(); ?>
          <?php endwhile;?>
        <?php endif; ?>

    So there is my loop. If I manually enter a cat id it works, but it won’t pull my ACF field. Thanks so far!