i have a php code that help me to add any button in wordpress quicktags toolbar:
add_action( 'admin_footer-post-new.php', 'pre_add_quick_tag' );
add_action( 'admin_footer-post.php', 'pre_add_quick_tag' );
function pre_add_quick_tag() { ?>
<script type="text/javascript">
edButtons[edButtons.length] = new edButton( 'pre', 'pre', '<pre>', '</pre>', '' );
</script>
}
now i want this pre button also added in bbpress (not just for admin, i want all users can use this button), any idea?
ps: i also asked this question here
Thank you @pekmez!! That is a perfect fix.
Note, this code is now on line 2266.
Cheers
Here in the Codex: https://codex.bbpress.org/import-forums/mingle/
Make sure to read the topic that’s linked at the bottom.
I have now also done live tests with all the themes that where in the list and that didn’t seem to repair the issue either. I read somewhere that someone else was having a similar problem but they could see the information in there source code of the page. When I checked that there was nothing, so I don’t think its a css problem but I could be wrong. Willing to attempt what ever, before our other guy just replaces it with something else.
Apache2 core log
[notice] child pid 17210 exit signal Segmentation fault (11), possible coredump in /etc/apache2
Hello, i need help with an issue! I have two images, and two different profile types, for example – if a user is of type profile a, then they will have image a, else they will have image b. I am assuming that this is a simple if/else statement but i am not sure where to inject the code.
WP Version – 3.8
BBpress Version – 3.5.1
URL – http://goo.gl/cP3yq9
Is your forum page just the root page or did you create a page and shortcode?
Thank You for that info. I set up the new directory and file like you mentioned. Do I need to do more or should it adapt.
I have the new bbPress folder created under the wp-content/themes folder and added the new php file to it.
Here are the forum pages I am messing with.
The basic forum root averageoutdoorsman.com/forums/
The new page using shortcodes averageoutdoorsman.com/ao-forums/
Nothing has changed in either since I created the suggested files. Do I need to specify the new theme file somehow?
Thanks for your help.
Matt
I password protected my most recent blog post and it is causing my BBPress forum searches (using the search widget on this page) to require the same password used for that post in order to return the search results. If I remove the password, the BBPress search no longer requires the password.
I opened a support ticket with the theme designer and he insists that it is a problem with the BBPress code rather than the theme. I was hoping someone could attempt to replicate the issue and/or help me solve my problem.
Thank you!
Hey there!
Yeah, its awesome! Never really liked bbP before I found out a way to layout the forums like that.
Here’s the way I’ve done it (looked it up somewhere, can’t remember where):
1. Create subdirectory called bbpress into your theme directory.
2. Inside the bbpress subdirectory, create a file called loop-forums.php
3. Place this code inside of it:
<?php
/**
* Forums Loop
*
* @package bbPress
* @subpackage Theme
*/
?>
<?php do_action( 'bbp_template_before_forums_loop' ); ?>
<?php while ( bbp_forums() ) : bbp_the_forum();
/* We print the header only if we want to show a category or if it's the first item of a no-parent forum list */
if (bbp_is_forum_category() OR !$bbp_forums_noheader)
{ ?>
<ul id="forums-list-<?php bbp_forum_id(); ?>" class="bbp-forums">
<li class="bbp-header">
<ul class="forum-titles">
<li class="bbp-forum-info"><?php if(bbp_is_forum_category()) { ?><a class="bbp-forum-title" href="<?php bbp_forum_permalink(bbp_get_forum_parent_id()); ?>"><?php bbp_forum_title(bbp_get_forum_parent_id()); ?></a><?php } else { _e( 'Forum', 'bbpress' ); } ?></li>
<li class="bbp-forum-topic-count"><?php _e( 'Topics', 'bbpress' ); ?></li>
<li class="bbp-forum-reply-count"><?php bbp_show_lead_topic() ? _e( 'Replies', 'bbpress' ) : _e( 'Posts', 'bbpress' ); ?></li>
<li class="bbp-forum-freshness"><?php _e( 'Last Post', 'bbpress' ); ?></li>
</ul>
</li><!-- .bbp-header -->
<?php } ?>
<li class="bbp-body">
<?php /* If the forum is a category, we're gonna make another loop to show its subforums and sub-subforums as if those were forums */
if(bbp_is_forum_category())
{
$temp_query = clone bbpress()->forum_query;
bbp_has_forums('post_parent='.bbp_get_forum_id());
while ( bbp_forums() ) : bbp_the_forum();
bbp_get_template_part( 'loop', 'single-forum' );
endwhile;
bbpress()->forum_query = clone $temp_query;
}
else /* Otherwise, we print the forums the normal way */
{
bbp_get_template_part( 'loop', 'single-forum' );
$bbp_forums_noheader = 1; /* This prevents the header part to be printed again on next post in the loop */
} ?>
</li><!-- .bbp-body -->
<?php /* Prints the footer only if :
- it's a category
- or if it's the last forum of a no-parent forum list
- or if the next forum in the loop is a category */
if( bbp_is_forum_category()
OR (bbpress()->forum_query->current_post+1) == bbpress()->forum_query->post_count
OR bbp_is_forum_category(bbpress()->forum_query->posts[ bbpress()->forum_query->current_post + 1 ]->ID))
{ ?>
<li class="bbp-footer">
<div class="tr">
<p class="td colspan4"> </p>
</div><!-- .tr -->
</li><!-- .bbp-footer -->
</ul><!-- .forums-directory -->
<?php unset($bbp_forums_noheader); /* Needed if we have 2+ no-parent forums with at least 1 category between them */
} ?>
<?php endwhile; ?>
<?php do_action( 'bbp_template_after_forums_loop' ); ?>
That should do the trick for you! Keep in mind, General, the Guild, Off-Topic etc. that you see in my site, are all categories. Under the categories I’ve made forums where you can actually post. I encourage you to do the same for this trick to work ๐
You can use css to make the list items li { display:block; }
You need to target it with specific class or ids though.
Good luck!
BParticipant
After a little digging, discovered my Custom Post Type Permalinks plugin wasn’t playing nicely with bbPress.
Problem and solution (albeit temporary) documented here: https://wordpress.org/support/topic/bbpress-topic-links-in-forums-break
Ultimately, edited the CPTP plugin file directly (ugh) line 290-something
$parentsDirs = "";
if( !$leavename ){
$postId = $post->ID;
if ( !in_array($post_type, array('topic', 'forum', 'reply') ) ) {
while ($parent = get_post($postId)->post_parent) {
$parentsDirs = get_post($parent)->post_name."/".$parentsDirs;
$postId = $parent;
}
}
}
BParticipant
Hi all,
Having a slight URL issue. Forums settings / slugs are default, permalink settings are using
/%postname%/
Forums URL is:
http://www.website.com/forums/
Forums topic URL one level down is:
http://www.website.com/forums/forum/website-community/announcements/
… where ‘website-community’ is the category, and ‘announcements’ is the first forum under that.
Here’s where it breaks. If I hover over a topic, the URL displays as:
http://www.website.com/forums/topic/website-community/announcements/first-topic/
… and if I click, I get a 404.
If I edit the URL manually, it will work as expected, I just have to take out the category and forum name from the url, such as:
http://www.website.com/forums/topic/first-topic/
Why are the category and forum titles appearing in the URL, and what’s the best way to fix?
Thanks in advance!
I really love how your forum is laid out. I have been trying to set mine up similar to that style and can’t get it. I really want the separated categories like that. I kinda got it working with shortcodes on a new page but its not that great. Do you mind sharing how you did yours?
BParticipant
@kaliceos thanks for sharing this. Have you ever gotten an undefined variable notice for bbp_forums_noheader?
if (bbp_is_forum_category() OR !$bbp_forums_noheader) { ?>
Curious if anyone’s gotten this error when doing a straight copy + paste into loop-forums.php
Hi guys! sorry but I forgot to pin the notifications for this post so I just realized about your replies..
it wasn’t very technical actually, but I think it depends a lot on the theme you have.
if just added a conditional into the class of my page template main content and of the sidebar wrap:
<?php if (is_bbpress() || is_page('forum')){ echo "forum_layout"; } ?>
it will have to be added something like this:
<div class="grid__item main float--left <?php if (is_bbpress() || is_page('forum')){ echo "forum_layout"; } ?>">
then is all about css, so it depends on yours. but you should be able to override the interested divs, appending your .forum_layout class in this way:
.grid__item.main.forum_layout {
width:76%;
}
.grid__item.sidebar.forum_layout {
width:24%;
}
then at the same you can override the normal layout fonts, colours, etc.. if something is not considering your new style, try adding !important in this way:
width:24% !important;
hope that’ll help! ๐
I’ve just made a button on the topic listing page, which send the variable using a GET url:
<a href="<?php bloginfo( 'url' ); ?>/new-topic/?related_forum_id=<?php bbp_forum_id(); ?>" >New Topic</a>
then in the template to display the new topic form, you add this:
<?php // get the var from the new-topic button
$related_forum_id = $_GET['related_forum_id'];
// display a warning if there is no info about the id
if ($related_forum_id=="") {
echo "WARNING! Something is wrong here! there is no info about the Related Forum where to append this Topic.<br/>Do not submit the new topic. Please go back and try again.";
}
// create a string with the shortcode
$form_shortcode = '[bbp-topic-form forum_id="'.$related_forum_id.'"]';
// execute the shortcode to display the form
echo do_shortcode($form_shortcode); ?>
Hi @avgmatt — Well, the category is kindda what I had in mind, but still wish there was a built in way in bbpress to structure a forum more like phpBB or vbullentin.
However, if you want the Categories to not be side by side..and List them under the main forum..check this link out. https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/
If you look at #1 – it gives you the exact line of code to put into your CSS to make it inline.
Hope that helps.
I want my forum root to display the a list of forums instead of their parent categories.
I am able to do this using these shortcodes on a page I added myself:
[bbp-single-forum id=10621]
[bbp-single-forum id=10623]
[bbp-single-forum id=10625]
[bbp-single-forum id=10627]
[bbp-single-forum id=10611]
You can see this working on my forum page. This is how I want my forum root to look.
But when navigating the forum, the breadcrumbs link to the ‘real’ forum root. When I add
echo do_shortcode('[bbp-single-forum id=10621]');
to the template file of this page it adds the categories index again (just like [bbp-forum-index] would).
How could I get the individual forums on the forum root OR change the links in my breadcrumb?
Thank!
WP 3.8
bbPress 2.5.1
Website: 24Baby
.post-content #bbpress-forums p
#bbpress-forums is inside .post-content by the look of it?
I am new to CSS and trying to change the formatting of my post-content div. My forum home page, and topic pages look okay but the margin in my post content page isnโt quite right. I can fix it by inspecting element and performing the change below, but then it reverts to being broke again.
I change it to this:
#bbpress-forums .post-content p {
margin: 0px 0px 0px !important;
display: block;
}
but then it reverts to this:
#bbpress-forums .post-content p {
margin: 0px 0px 20px;
display: block;
}
Any idea what Iโm doing wrong? Forum is here:
http://www.planitnz.com/new-zealand-travel-forum
Hi, I’m looking for a solution to display a list of sticky posts. I currently have a list of all recent topics displaying -> http://kohler.surefiresocial.com/featured-articles/ but I want to restrict this to just sticky posts. I am using the short-code [bbp-topic-index] to display the topic index.
Basically, I am stuck as to should i modify and create a short-code or drop in a custom query? any help would be greatly appreciated.
Thanks in advance.
WP Version – 3.8
BBPress Version – 2.5.1
URL – http://kohler.surefiresocial.com/featured-articles/
In which file(s)/locations can I find the code for the built in bbpress widgets? Most specifically I’m looking for the recent topics widget. Sorry if this is a dumb question, but I’ve never needed to modify a widget before now and my searches have turned up nothing.
I am wanting to make my own version that will allow it to recursively check sub forums of the specified parent forum as well so a category can be specified instead of just a single forum.
Thanks!
I had a look at the data in both your previous posts and I can only find SELECT SQL statements, there are no INSERT INTO or UPDATE SQL statements that cause the creation or updates into the database so these don’t help us much, not sure what/where we should be looking for more help here.
There is the following plugin by one of the WordPress core devs @dd32 https://wordpress.org/plugins/revision-control/
I have sent him an email asking for some tips on what else we should be looking for.
It looks like you have a page at http://www.ladiesbalance.com/forums/
When viewing a topic or forum eg:
http://www.ladiesbalance.com/forum/forums/chat-beauty/
http://www.ladiesbalance.com/forum/topic/this-is-a-test/
The breadcrumb link is pointing to /forum
It looks like you have your ‘Forums Prefix’ and ‘Single Forum Slugs’ around the wrong way.
Use forums as your forum prefix (the same as your forums page)
Use forum as the single forum slug.