Forums

Join
bbPress Support ForumsRequests and Feedback'bbPress Topics list' widget, outside loop

Info

Tags

'bbPress Topics list' widget, outside loop

  1. I want to use 'bbPress Topics list' widget, outside widget.
    I'd very happy that someone let me know the code to use it outside widget.

    Thank you in advance.

  2. I don't understand the question

  3. //anointed, I must say sorry if I bothered you.

    You might see the 'bbPress Topics list' widget, in wordpress widgets. I meant I want to use the widget 'outside the loop'.

    That must be done the code like below:

    <?php
    if ( bbp_has_topics( array( 'author' => 0, 'show_stickies' => false, 'order' => 'DESC', 'post_parent' => 'any', 'posts_per_page' => 5 ) ) )
    bbp_get_template_part( 'bbpress/loop', 'title' );
    ?>

  4. NO, not bothered at all, was just saying that I didn't understand what you were asking is all.

    If I understand you basically want to take the code from the topics widget and use it as a standalone loop instead of a widget?

    Keep in mind I'm not a great coder: If it were me, I would simply copy the code from the bbp-core-widget.php file that I needed for the topics widget. I would then strip out the widget portion of the code and hard code in the default arguments.

    This basically would give me the same loop used by the widget.

    // Query defaults
    		$topics_query = array(
    			'author'         => 0,
    			'post_parent'    => any,
    			'posts_per_page' => 10,
    			'show_stickies'  => false,
    			'order'          => 'DESC',
    		);

    Probably better ways out there, but that's how I would try it

  5. You must log in to post.