@casiepa thank you for the help 🙂
@robkk your code has worked perfectly 🙂 thanks a lot 🙂
Hi, I’m trying to make some filters in my single-forum and other pages queries, but my changes with pre_get_posts results in “Content not found”.
Here’s a example of my code:
function bbpress_site_queries( $query ) {
if ( $query->is_main_query() && $query->is_single( 'forum' ) ) {
$query->set( 'order', 'DESC' );
}
}
add_action( 'pre_get_posts', 'bbpress_site_queries' );
What is wrong? There’s other way, better to modify bbPress queries? I want to change queries to make in front-end some order and other filters.
Sorry this isn’t the best of experiences 🙁
Can you try the 2.6 alpha version, available from this page as “development version”
• https://wordpress.org/plugins/bbpress/developers/
• aka https://downloads.wordpress.org/plugin/bbpress.zip
Also if you “right click” any of the items as they import and select “Inspect element” to view the source code you will see the direct MySQL queries as they happen, you can then use these to help debug directly in phpMyAdmin 🙂
Good day guys!
I have the same issue with two forums; an English and a French one.
When I shortcode to one from a page called up by a menu item, it displays fine, but when I do the same from another menu item(the French one) from another page, and shortcode to the other forum, then bbPress shows both of the forums.
See it here.
http://www.businessperformances.com
Hey – I entered the code above in my child theme functions php file and my site went white. No pages would come up – all just white.
In chrome it said 500 error – in firefox just white screen. Any ideas?
@robkk
Hi, I’m looking for this kind of code for a long time and I’m so glad to find it. But I didn’t understand that where I should paste this code?
Thanks 🙂
@kallard
Checking your site again, the padding for the bbPress forum header that shows the labels looks a little cozy to the left, you may need to edit the padding-left: 0 !important;, by default I think the padding is set to about 8px, maybe setting 0 to 8px or removing the !important might help with that.
@casiepa
That code will make it where if you visit your profile the title tag will display Your, instead of, Your Profile, Your Topics, or Your Favorites, etc.
@deall
Use something like this for only the single topic, and single forum pages.
Add this php code snippet into your child themes functions.php file, or in a plugin like functionality.
function rkk_custom_titles( $new_title ){
if ( bbp_is_single_forum() ) {
$new_title['format'] = esc_attr__( '%s', 'bbpress' );
// Topic page
} elseif ( bbp_is_single_topic() ) {
$new_title['format'] = esc_attr__( '%s', 'bbpress' );
}
return $new_title;
}
add_filter( 'bbp_before_title_parse_args', 'rkk_custom_titles' );
Hi,
You will have to look for the bbp_before_title_parse_args filter. Just an example below, but it will need tuning probably:
function bbppc_format_titles( $new_title ){
// Format to title only
$new_title['format'] = '%s';
return $new_title;
}
add_filter( 'bbp_before_title_parse_args', 'bbppc_format_titles' );
Pascal.
No it is not really about content, what I think your experiencing is a bug. I have seen it before on these forums.
It has to do with using lists <li> and not surrounding it in an unordered <ul> or ordered list <ol>.
This issue might be happening, because bbPress uses lists for its forum layout.
To fix it, you can edit your post and make sure that the lists <li></li> have a surrounding unordered or ordered list around it like so.
<ul>
<li>Some List</li>
</ul>
How do I add the number of posts under the name and the symbolic images of the user?
Post count is coming to a future release of bbPress. You can use a plugin like this to add the counts for now.
https://wordpress.org/plugins/bbp-topic-count/
What exactly do you mean by symbolic images??
How do I change the title to any user of an optional title?
Ex: the title of the current user in the Forum (supervisor) want to have the title of supervisor (supervisor pictures)
You can rename the current forum roles to whatever you want with this php code snippet in this guide. Add the function to your child themes functions.php or in a plugin that can hold custom code snippets like functionality.
Layout and functionality – Examples you can use
You can also create custom user roles with custom capabilities and add the custom names there.
Custom Capabilities
How to determine the powers of the supervisors so far have not I transfer Lists Musharraf to it have all the powers modification and deletion of all sections I wanted to be the powers of the supervisor on only a particular section
Assigning a user to a forum is not possible in the default functionality of the latest stable version of bbPress.
I am not sure where to put the above or which ones to use.
Place the php code snippet into your child themes functions.php file or place the snippet in a plugin like functionality.
Undefined variable: bbp_forums_noheader in /wp-content/themes/multinews/bbpress/loop-forums.php on line 19
any suggestions what this might be?
Thanks
Hi,
You could use the redirect feature of the login that results in a URL like this:
http://www.example.com/login/?redirect_to=http%3A%2F%2Fwww.example.com%2Fmyfolder%2Fmypage%2F
Pascal.
All I want is a forum on the entry site of my wordpress and nothing else. I supposed that for this I need to make a page and use one of the bbpress shortcodes. BUT this does not work. No matter what I enter as a shortcode, I get back an empty page.
I’ve seen some old entries that there is a “whitelist” plugin, but there is no mentioning anywhere on bbpress that this is needed -I don’t get it.
Could anyone help here and enlighten me?
Regards,
Benny
Hello,
Thanks for a quick reply but can I add the above code in Custom URL in Menu in wordpress ?
or where exactly should I use it in which file. and any con ditional logic to be implemented ?
Thanks,
Vicky
Hi Vicky,
Does this help ?
<a href="'. wp_logout_url() .'">Log Out</a>
Pascal.
Hi,
What you want to obtain is not just a basic setting in bbPress that you can switch on. It requires changing one of basic php files. As the golden rule is to never change any bbPress files directly, there are different ways of coming to what you want, in this case it would be copying the file from the bbPress folder/directory and modifying it. Information on creating a child theme can be found on the codex: https://codex.bbpress.org/functions-files-and-child-themes-explained/
Hope that helps,
Pascal.
Thanks @Robkk for the respond. but i have question about
Put this loop-forums.php file in your child theme in a folder called bbpress.
i only have child theme for the theme but bbprss is a plugin. are you saying i have to create a child theme for the plugin bbpress of how do i do that please?
There is a plugin called bbp style pack that can give you a shortcode to display the latest number of topics on your site. bbPress has this shortcode for the forum archive, [bbp-forum-index]
You said there is a plugin to display latest post, how do i get the plugin?
Thank you so much.
Hi,
To remove the messages above and below, you could use CSS like:
.bbp-template-notice {
display: none;
}
or use a plugin like bbP Toolkit.
To change the message so it includes the standard bbPress login, you would have to copy ‘bbpress/templates/default/bbpress/form-reply.php’ to your child theme and then adapt the file. On line 175 add:
<p> <?php echo do_shortcode ('[bbp-login]') ; ?>
so that it becomes:
<p><?php is_user_logged_in() ? _e( 'You cannot reply to this topic.', 'bbpress' ) : _e( 'You must be logged in to reply to this topic.', 'bbpress' ); ?></p>
<p><?php echo do_shortcode ('[bbp-login]') ; ?></p>
If you want to do something different, this is anyway the place to start from.
Pascal.
My function is just using a hook and some custom code to add an image. Put the code in your child themes functions.php file instead.
Please find enclosed a link for the test Website:
Well I am not seeing an issue with my forums disappearing with WP Monalisa activated.
Where do I activate TinyMCE and find the default toolbar editor in WordPress? Or are you talking about BBPress Dashboard?
Well your not using TinyMCE so you would see the error I come across. Like said there is an issue, so you may not need to activate it. There is a plugin on wordpress repository and a code snippet in the codex to allow TinyMCE.
As previously mentioned it didn’t work with a freshly installed bbPress Website. I had nothing else installed except the bbPress Forum. The enclosed totius.tk however is now a plugin.
Yes, wordpress plugins do not work for the old standalone version, but with the plugin version. I cannot test to see if an install of bbPress v1 would cause an issue, as I cannot run this on wamp. Kind of do not know how to install bbPress v1 anyway.
Sorry, I forgot to post the WordPress Dashboard that comes up for Settings/Writing:
A new version of WordPress probably removed the smilies setting like the wp monalisa plugin says, there was a version with that setting before.
Just ignore that error, it might be caused by something other than bbPress.
bbp_setup_current_user was called incorrectly
If you did not try the plugin troubleshooting already, do so.
@seyibest Put this loop-forums.php file in your child theme in a folder called bbpress.
https://github.com/robkk/bbPress-Hierarchical-Forum-and-Category-Layout
so, how do i make it to be in a place like just only Login/Register on just a menu bar like
They added custom menu item links in the menu section. You can create links leading to the WordPress login/register forms. There is also this php code snippet here to add links, you might need to add a conditional to it for a specific menu.
add_filter( 'wp_nav_menu_items', 'rkk_add_auth_links', 10 , 2 );
function rkk_add_auth_links( $items, $args ) {
if (is_user_logged_in() {
$items .= '<li><a href="'. wp_logout_url() .'">Log Out</a></li>';
}
elseif (!is_user_logged_in() {
$items .= '<li><a href="'. site_url('wp-login.php') .'">Log In</a></li>';
$items .= '<li><a href="'. site_url('wp-login.php?action=register') .'">Register</a></li>';
$items .= '<li><a href="'. site_url('wp-login.php?action=lostpassword') .'">Lost Password</a></li>';
}
return $items;
}
and moreso, i made the homepage to be the forum. how can i code it in such a way that 2-3 of my post will appear on the homepage follow by the forum beneath it?
There is a plugin called bbp style pack that can give you a shortcode to display the latest number of topics on your site. bbPress has this shortcode for the forum archive, [bbp-forum-index]
There could be a plugin that affects TinyMCE that could be causing this issue. Try some plugin troubleshooting.
Troubleshooting
I could also check out your theme if you tell me what it is.