thanks, sam. tried several codes, nothing worked unfortunately (blank page):(
add_action( 'loop_start', 'divs_only_when_logged_in' );
function divs_only_when_logged_in() {
<?php if ( is_user_logged_in() ) {?>
<div class="new-reply-link">
<a href="<?php bbp_topic_permalink(); ?>#new-post
"class="reply-link-text">Reply</a>
</div></br>
<ul id="bbp-topic-<?php bbp_topic_id(); ?>-lead" class="bbp-lead-topic">
<li class="bbp-header">
<div class="bbp-topic-author"><?php _e( 'Author', 'bbpress' ); ?>
</div>
<?php endif; ?>
}
?>
try the wp “is_user_logged_in” function
https://codex.wordpress.org/Function_Reference/is_user_logged_in
<?php
if ( is_user_logged_in() ) {
echo 'Welcome, registered user!';
} else {
echo 'Welcome, visitor!';
}
?>
or
<?php if ( is_user_logged_in() ) { ?>
<p>Welcome logged in user<p>
<?php endif; ?>
sam
Hi,
is there anyone who can help me to get this part
<div class="new-reply-link">
<a href="<?php bbp_topic_permalink(); ?>#new-post
"class="reply-link-text">Reply</a>
</div></br>
<ul id="bbp-topic-<?php bbp_topic_id(); ?>-lead" class="bbp-lead-topic">
<li class="bbp-header">
<div class="bbp-topic-author"><?php _e( 'Author', 'bbpress' ); ?>
</div>
<!-- .bbp-topic-author -->
into an if-statement for logged in users?
I suppose that
<?php if ( bbp_is_user_logged_in() ) { ... } ?>
does not work that simple due to the additional php within, right?
(no success so far..)
This custom function should remove the “forums” in the breadcrumbs.
Put it in your child theme functions.php or a functionality plugin to place custom code snippets.
function rkk_custom_bbpbreadcrumbs() {
// Remove Forum root from bbPress breadcrumbs
$args['include_root'] = false;
return $args;
}
add_filter('bbp_before_get_breadcrumb_parse_args', 'rkk_custom_bbpbreadcrumbs');
your theme thinks bbPress is a blog post.
usually modifying the main bbPress template will help fix this.
https://codex.bbpress.org/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/
Sorry, I just retyped my problem. I forgot to encode the error code.
Hi,
I expect to add a Login/Logout to the menu,however,I encountered this syntax error (indicating in the title) while editing the theme functions.php. According to the error message,
$loginlink = '</pre><ul><li><a title='Logout' href="'.$url2.'">Logout</a></li></ul><pre>';
is the code causing this parse error.
Since this code is provided in the documentation and works fine for others, I wonder what the problem is.
Hope you can help. Thank you so much!
Hi,
I expect to add a Login/Logout to the menu,however,I encountered this syntax error (indicating in the title) while editing the theme functions.php. According to the error message,
$loginlink = ‘
';
is the code causing this parse error.
Since this code is provided in the documentation and works fine for others, I wonder what the problem is.
Hope you can help. Thank you so much!
you still have an issue??
usually people forget the <?php at the start of the functions.php file in their child theme?? if that is it.
You can also just create a new one then see what code is screwing up your site.
Just shy away from using shortcodes for forum pages , it will be time consuming. You would have to possibly create pages for all instances of any bbPress page. This includes topic pages and user profile pages.
The way you could get a non-fullwidth layout is to contact your theme author , which I think is Avada for help. Since they have more knowledge of how the theme works and I can’t just buy a theme and test it out and tell you what to do to have this layout.
You could also do this manually with my help guiding you, but you would need some basic knowledge of how WordPress templates work.
This guide will help with getting the layout , you would need to add the sidebar code back in like how the example template has. Please note that that is just an example template and is not something to copy and paste since all themes are different.
https://codex.bbpress.org/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/
I interprete your “use WordPress as CMS not as blog” as : use “show static page” instead of “show last posts” in “customization”…
CMS is an acronym content management system, and what I mean is instead of using WordPress for creating blog posts you can just use to manage your forums, users, etc.
So I should put the bbPress root template as this static page. and fix the root folder as “” ?
that what you suggest ?
You could use the forum index shortcode [bbp-forum-index] or [bbp-topic-index] and place this in a page and make that your front page if that is what you want.
Or create a custom homepage template to use like this site has.
Read this for information about that. Creating Page Templates
bbPress
I don’t want to have a “/forum” in the URL.
As for removing that I dont think you can , you can remove /forums though in settings > forums.
You can rename /forum to whatever you want though.
Hello Everyone!
I have my forums installed and I am happy with it. Now I would like to add a checkbox to the edit profile screen..
I know in form-user-edit.php I can find the code that displays the fields, but can someone give me some insight into how this information is processed once the form is submitted?
I know that this hidden field holds the action name:
<input type=”hidden” name=”action” id=”bbp_post_action” value=”bbp-update-user” />
but after looking at the file bbpress\includes\users\functions.php, where that action is being defined I don’t see where I could add in the extra code to process the custom field if I were to add it.
I hope I am being clear, all I want to do is add ONE checkbox to every users edit profile page(where they change password/email), and save to user_meta… I know how I can add the field to the front end, but am unsure of how the data gets processed…
Thanks,
Anthony
I think you would have to use Multi-site , there are parts of the multisite installation to include either sub-directories or sub-domains.
And you do not have to use WordPress for a blog , you can just use it instead as a CMS.
https://codex.wordpress.org/Create_A_Network
Go through some troubleshooting steps.
It might be a conflicting plugin so leave bbPress and Jetpack activated.
Troubleshooting
@kenneston
do you have a custom bbPress theme??
because the forum description should show on the frontend
the topic description does not show below the topic title like the forum description should do by default.
All titles should show though.
for the forum description make sure you have
<div class="bbp-forum-content"><?php bbp_forum_content(); ?></div>
in loop-single-forum.php
Try some troubleshooting steps listed here.
If they say the issue persists in a default theme , then it either is a plugin issue or just how you are trying to set up your forums.
Troubleshooting
This is caused because bbPress is rendering a certain template in your theme , this happens to be a template that is full width without a sidebar.
Is your theme a premium theme or a free theme??
If it is free, I can check it out and tell you what you need to do.
If it is premium , the theme authors will have to help you as I cannot just buy a theme just to test it.
see if this guide can help you though?? It tells you about modifying the main template , you can use this to put the sidebar back in.
If you have any questions about it or suggested improvements please let me know.
https://codex.bbpress.org/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/
the forums shouldn’t show up in pages > all pages
I am guessing you have put shortcodes in pages to do this.
I guess if you want to keep putting shortcodes in pages , which will be time consuming , you can use the [bbp-forum-index] shortcode
I was thinking in lines of:
$reply_count = bbp_get_user_reply_count_raw( $user_id);
if($reply_count==0)
echo "<span class='mycustom_new_label'>";
echo "New";
echo '</span>';
Any help would be appreciated regarding how to go about doing it.
Hello!
I successfully implemented the code put up here – New Topics so as to show a new tag next to a topic in forum. But as per this link, the new tag will flash until 3 days. I would want to modify it such that the tag disappears once a user replies to the topic. Is there any function to get this functionality?
Thanks!
The bbp-signature plugin is designed to work with bbpress not with buddypress, so it works fine – I’ve amended your original post to reflect that for future users in the first post to save them needing to read the whole thread.
But the code wasn't too terrible
General open software etiquette is not to insult other software authors, we are all at different levels and any software that works is useful 🙂
The original author of this software is unable to continue supporting it, so I have access to it so that it can continue.
I think it was made to work with buddypress groups whitout xprofiles yes. A simple update could fix that.
If you’d care to suggest code that would make it work for users with and without buddypress, please contact me via my website, as I’d love to include it in the plugin
http://www.rewweb.co.uk
Your site is not available so I can’t have a look.
If you’re using a custom theme with ‘theme options’ you need to look at the settings there to see if the default setting is with a sidebar, your forum will use this default page unless you create templates specially for it.
Here’s some info on the templates that bbpress looks for in your theme:
https://codex.bbpress.org/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/
Usually using page.php in most themes, so you could try opening up your page.php, remove the code that includes a sidebar, then save it as bbpress.php
Please can someone advise how the code above could be used only if using the reply form within a certain forum? e.g Forum ID 20
I’ve tried the following at a guess but it’s not working…
add_filter( 'bbp_get_the_content', 'amend_reply', 10, 3);
Function amend_reply ($output, $args, $post_content) {
if ( bbp_is_single_forum('20') ) {
if ($args['context'] == 'reply' && $post_content == '') $output=str_replace('></textarea>', 'placeholder="Reply..." ></textarea>',$output) ;
return $output ;
}
}
or
add_filter( 'bbp_get_the_content', 'amend_reply', 10, 3);
Function amend_reply ($output, $args, $post_content) {
if ($args['context'] == 'reply' && $post_content == '' && bbp_is_single_forum('20') ) $output=str_replace('></textarea>', 'placeholder="Reply..." ></textarea>',$output) ;
return $output ;
}
or the same but using ‘bbp_is_forum_archive()’
Many thanks for any help anyone can give me.