Info
- 4 posts
- 2 voices
- Started 8 months ago by venividi
- Latest reply from Anointed
'bbPress Topics list' widget, outside loop
-
- Posted 8 months ago #
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.
-
- Posted 8 months ago #
I don't understand the question
-
- Posted 8 months ago #
//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' );
?> -
- Posted 8 months ago #
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
-
You must log in to post.