• Hi, I have a custom post type, and the following query is working. I’m using Shortcode Exec PHP to use it in my page.

    $args = array( 'post_type' => 'testimonial', 
    
    'posts_per_page' => 1, 'orderby' => 'rand' );
    
    $loop = new WP_Query( $args );
    while ( $loop->have_posts() ) : $loop->the_post();
    
        echo '<div class="test-text">';
        the_excerpt(); echo '</div>';
    endwhile;

    However, I need it to appear in two places, side by side. That’s working, too, but I need to ensure that the same result never appears in the two places. Is it possible to do a result +1 type of query for the second one? Or, I have set up categories of left and right (slug), but I don’t seem to be able to query a specific category for each side.

    Any suggestions as to what I might be missing? THanks.

  • The topic ‘Query category help, custom post type’ is closed to new replies.