Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to display in Wordpress search results page - 10 or less found results from BBPress (plugin) forums. I know that BBPress use custom post types (forum, topic, reply) but I don't know how to do it. I try with WP Query, but it didn't show nothing. I don't want to override BBPress search page and functions, I just want to show some results in Wordpress search page. Is this possible?

Thank you all in advance.

Here is the query I try:

<?php 
    // The Query
    $the_query = new WP_Query( array (
        'post_type' => array('topic', 'reply'),
        'posts_per_page' => 10,
        's'=> $s
    ));

    // The Loop
    if ( $the_query->have_posts() ) {
        while ( $the_query->have_posts() ) { $the_query->the_post();
            echo '<li>' . get_the_title() . '</li>';
        }
    } else {
    // no posts found
    }
    /* Restore original Post Data */
    wp_reset_postdata();
?>
share|improve this question
    
I try with WP Query, but it didn't show nothing Please share what you tried. So that, others can help in making it work! –  Pothi Sep 17 '13 at 10:41
    
I edited my first post. –  Dido Kotsev Sep 17 '13 at 11:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.