Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jengstromdesign

    (@jengstromdesign)

    No problem, I asked Rob to post it out on twitter for me!

    Just tried using new WP_Query as below, but I get the same result as my first block of code, in that it works but only for the first CPT.

    <?php $categorynumber = get_post_meta($post->ID, 'Category Number', true); ?>
    
    <?php $args=array(
      'cat' => $categorynumber,
      'post_type' => array( 'lathes', 'barfeeds', 'accessories' ),
      'post_status' => 'publish',
      'posts_per_page' => -1,
      'caller_get_posts'=> 1
    );
    
    $new = new WP_Query($args); ?>
    
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
       /*Loop Content*/ 
    
    <?php endwhile; endif; ?>
    
    <?php wp_reset_postdata(); ?>
    Thread Starter jengstromdesign

    (@jengstromdesign)

    Hi Ryan,

    Thanks but I already tried that. It brings up a sever error and doesnt work at all!

    Also tried using $args to state the loop parameters and get the same result, as in all 3 CPTs work, but the category does not.

    I think you are right, the issue should be with the sytax of that line, but nothing I have tried works, and I can’t find the solution anywhere!

    Jon

Viewing 2 replies - 1 through 2 (of 2 total)