Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

CPT Loop Query; Showing when minimum of 2 and without current?

$
0
0

Replies: 0

Hi all,

Currently I am working on a certain CPT, which lists other cpt’s when related by a certain id. But I would love to only show this when there is at least 1 other cpt with thesame ID. Also, I’d like to remove the current cpt from the list. Who can help me out here?

This is what I could find so far:

<?php 
$args = array( 
'orderby' => 'title',
'post_type' => 'cats',
'meta_key'		=> 'uniquekey',
'meta_value'	=> $uniquekey
);
$the_query = new WP_Query( $args );
?>

Viewing all articles
Browse latest Browse all 59525

Trending Articles