Search Results for 'bbpress'
-
Search Results
-
I’m trying to create a custom forum index page which should look exactly like the default forum index page with forum names, number of topics, number of posts, last active topic etc. but sorted alphabetically based on forum names.
I’m looking at at bbp_has_forums, bbp_forums and bbp_list_forums inside /wp-content/plugins/bbpress/bbp-includes/bbp-forum-template.php.
However, I’m puzzled which function to use and
What arguments/ parameters I should pass?
the comments in bbp-forum-template.php itself says the same parameters as WP_Query() but would it make sense at all to have something like “post_type” => “forum”
I’m sure one can be clearer/ more explicit about the parameters here in some form of documentationI gave it wild tries as follows
1) The following gives me fatal error:
$args = array('orderby' => 'title',
'order' => 'ASC',);
while (bbp_forums($args)){
bbp_the_forum();echo bbp_get_template_part( 'content', 'archive-forum' );
}
The error:
Fatal error: Call to undefined method stdClass::have_posts() in C:\www\forums.local\wp-content\plugins\bbpress\bbp-includes\bbp-forum-template.php on line 109 Call Stack: 0.0004 333592 1. {main}() C:\www\forums.local\index.php:0 0.0006 337280 2. require(‘C:\www\forums.local\wp-blog-header.php’) C:\www\forums.local\index.php:17 0.3864 38499368 3. require_once(‘C:\www\forums.local\wp-includes\template-loader.php’) C:\www\forums.local\wp-blog-header.php:16 0.3920 38515824 4. include(‘C:\www\forums.local\wp-content\themes\bp-tap\custom-index.php’) C:\www\forums.local\wp-includes\template-loader.php:43 0.4732 38674368 5. bbp_forums() C:\www\forums.local\wp-content\themes\bp-tap\custom-index.php:422) While the following just takes forever to load:
$args = array('orderby' => 'title',
'order' => 'ASC',);
while (bbp_has_forums($args)){
bbp_the_forum();echo bbp_get_template_part( 'content', 'archive-forum' );
}
I’m using WordPress 3.4.2 and bbPress 2.1.2.
I’ve copied all files and directories from/wp-content/plugins/bbPress/bbp-themes/bbp-twentyten/to my theme directory.- This topic was modified 13 years, 11 months ago by .
- This topic was modified 13 years, 11 months ago by .
- This topic was modified 13 years, 11 months ago by .
- This topic was modified 13 years, 11 months ago by .
- This topic was modified 13 years, 11 months ago by .
- This topic was modified 13 years, 11 months ago by .
- This topic was modified 13 years, 11 months ago by .
- This topic was modified 13 years, 11 months ago by .
I finally started playing with bbPress. There are lot to learn because I want to display topics totally differently what is the default output.
First I want to display latest topics by latest activity like usual. I’ve created archive-topic.php in my theme so I can decide output.
After that I can filter topic post type so that topics are ordered by latest activity.
add_action( 'pre_get_posts', 'my_filter_topic' );function my_filter_topic( $query ) {
if( $query->is_main_query() && is_post_type_archive( 'topic' ) ) {
$query->set( 'meta_key', '_bbp_last_active_id' );
$query->set( 'orderby', 'meta_value_num' );
$query->set( 'order', 'DESC' );}
}
But this doesn’t display sticky posts first. They are more like last. Does someone have an idea how I get sticky posts to show first?