I'm using bbPress. I'm in a single page of the custom post type
bbp_topic. As you can imagine this custom post type stores another custom post type called
bbp_reply. I'm using the following query to list the most voted replies at the top (like Youtube), helped by the GD start rating plugin:
<?php $custom_posts = new WP_Query(); ?> <?php $custom_posts->query('gdsr_sort=thumbs&post_type=bbp_reply&posts_per_page=2'); ?> <?php while ($custom_posts->have_posts()) : $custom_posts->the_post(); ?> <div class="content-block-2"> <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a> <?php the_content(); ?> </div> <?php endwhile; ?>
The problem is that the query is listing all the replies from all the
bbp_topic custom post type. I need to query something like this: list all the custom post types
bbp_reply from this single
bbp_topic custom post type you are viewing right now.
(I know how to get the ID of the current
bbp_topic custom post type:
$post->ID but I'm not very sure how to use it).