How to query specific bbPress topics
-
Hi!
Is it possible to query specific bbPress topics by an array of their associative post IDs? I don’t want to create a custom template for this and I want to take advantage of bbPress functions and features if possible.
I have done this:
add_action('wp', function() { if( isset( $_GET['my_variable'] ) ) { $page = get_query_var('paged') ? get_query_var('paged') : 1; $ids = array( 894, 901 ); query_posts(array( 'paged' => $page, 'post_type'=> 'topic', 'order' => 'ASC' )); } });
But it returns all of the forum topics if I access
site.ext/?my_variable=1
.How can I get this to work, using
query_posts
orWP_Query
, or any other workaround? How can we target those specific topics and show them as a list as well as taking advantage of bbPress templates?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to query specific bbPress topics’ is closed to new replies.