Thank you!
I’ll have to hire someone technical to help me add the code to my website! This is way outside of typical support, so I appreciate all your help Robin!
No need to reply, take care!
try
add_action( 'bbp_template_before_forums_loop', 'rew_add_custom_menu' );
add_action( 'bbp_template_before_topics_loop', 'rew_add_custom_menu' );
function rew_add_custom_menu () {
echo '<a href= "https://bbpress.org/forums/">customs menu area</a>' ;
}
Thanks for the code. I did as you said.
I opened the incognito browser and a forum.
When wanting to comment on a reply it still opened the reply box at the bottom of the list rather than immediately under the post I wished to reply to.
Thanks for the help. Next step??
Regards
Simon Pollit
what is the issue with your code above?
untested but add this to your functions file or use code snippets plugin
add_action( 'bbp_template_before_forums_loop', 'rew_add_custom_menu' );
add_action( 'bbp_template_before_topics_loop'', 'rew_add_custom_menu' );
function rew_add_custom_menu () {
echo 'your link here' ;
}
ok, so
1. Save the attached code to your pc, as a new file called reply.js
2. Create a directory on your theme called โjsโ, and copy the renamed file reply.js to it, so that you end up with wp-content/themes/%my-theme%/js/reply.js
where %my-theme% is the name of your theme
Let me know if this works
addReply = {
moveForm : function(replyId, parentId, respondId, postId) {
var t = this, div, reply = t.I(replyId), respond = t.I(respondId), cancel = t.I('bbp-cancel-reply-to-link'), parent = t.I('bbp_reply_to'), post = t.I('bbp_topic_id');
if ( ! reply || ! respond || ! cancel || ! parent )
return;
t.respondId = respondId;
postId = postId || false;
if ( ! t.I('bbp-temp-form-div') ) {
div = document.createElement('div');
div.id = 'bbp-temp-form-div';
div.style.display = 'none';
respond.parentNode.insertBefore(div, respond);
}
reply.parentNode.insertBefore(respond, reply);
if ( post && postId )
post.value = postId;
parent.value = parentId;
cancel.style.display = '';
cancel.onclick = function() {
var t = addReply, temp = t.I('bbp-temp-form-div'), respond = t.I(t.respondId);
if ( ! temp || ! respond )
return;
t.I('bbp_reply_to').value = '0';
temp.parentNode.insertBefore(respond, temp);
temp.parentNode.removeChild(temp);
this.style.display = 'none';
this.onclick = null;
return false;
}
try { t.I('bbp_reply_content').focus(); }
catch(e) {
}
return false;
},
I : function(e) {
tinymce.execCommand('mceFocus',false,'bbp_reply_content');
}
}
Thanks but afaik this is what tells you if you are on the forums directory: bbp_is_forum_archive()
Is there a call to see if the user is on the all forums directory page?
The one that lists all the forums?
Something like bbpress_is_forums_directory()
2 things occur
1. this is the code in the template
<li class="bbp-topic-voice-count"><?php bbp_topic_voice_count(); ?></li>
<li class="bbp-topic-reply-count"><?php bbp_show_lead_topic() ? bbp_topic_reply_count() : bbp_topic_post_count(); ?></li>
2. these functions are looking for id so maybe
<?php $post_id=get_the_ID() ; ?>
<li class="bbp-topic-voice-count"><?php bbp_topic_voice_count($post_id); ?></li>
<li class="bbp-topic-reply-count"><?php bbp_show_lead_topic($post_id) ? bbp_topic_reply_count($post_id) : bbp_topic_post_count($post_id); ?></li>
untested, but you get the idea
@robin-w
Thank you for the feedback.
It’s good that the issue is already addressed.
But the question is not about dequeuing, but about enqueuing.
Why not the bbPress core, enqueue the stylesheet only when is_bbpress() is true?
Hi everybody,
I made a custom display of topics for a specific forum. Like this:
<?php $args = array( 'post_type' => 'topic', 'posts_per_page' => 10, 'post_parent' => '410' );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post(); ?>
<div class="bbp-forum-table__content--grid ">
<div class="topic-title"><a href="<?php bbp_topic_permalink(); ?>"><?php the_title(); ?></a></div>
<div class="replies-counter"><?php bbp_topic_voice_count(); ?></div>
<div class="posts-counter"><?php bbp_topic_post_count(); ?></div>
<div class="user-freshness"></div>
</div>
<?php endwhile;?>
But it’s seems that counter isn’t correct… Did I need to add something to count correctly the voice_count and post_count ?
I already try the repair tools ๐
Thanks a lot ๐
Hi,
Based on my content-archive-forum.php.
I would like to creat a custom WP_Query like:
<?php $args = array( 'post_type' => 'topic', 'posts_per_page' => 10, 'post_parent' => '410' );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
the_title();
endwhile;
?>
to list topic of forum with ID=410 and also message counter and freshness if it’s possible .. But I didn’t find the way to do this… Do you have a tips or exemple ? This will be very helpfull because It can solve many issue I have ahah
sure it’s in
\bbpress 2.5.13\includes\common\shortcodes.php
Sadly no it’s on my local wamp. But I can explain you of course (my bad it’s blur !).
I just tried to analyse what’s happend to explain to you. And I realize that
<?php echo do_shortcode( โ[bbp-single-forum id=123]โ ); ?> did the same template content-archive-forum.php but with the [bbp-single-forum id=123] at the end.
It seems like there is something wrong with a loop or something. Do you know where I can learn what [bbp-single-forum id=123] did exactly ?
But when I try to use <?php echo do_shortcode( โ[bbp-single-forum id=123]โ ); ?> itโs a mess.
without knowing what ‘it’s a mess’ means, not sure I can help – do you have a link to the site?
Hi everybody,
I’m actually developing a Forum for a WordPress site.
My Home is composed by 3 sections. Each section is a Forum who list child forum (I’m ok with that it’s already ok). But the last section need to be a Forum who list topics of this Forum.
But when I try to use <?php echo do_shortcode( ‘[bbp-single-forum id=123]‘ ); ?> it’s a mess.
my content-archive-forum.php looks like:
<div id="bbpress-forums">
<div class="bbpress-header">
<div class="bbpress-header__image">
<img src="image.png" alt="Illustration sabre - Forum">
</div>
<div class="bbpress-header__headline"><h1>Welcome</h1></div>
<div class="bbpress-header__lead-paragraphe">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. <span>Donec vel auctor diam.</span>
Nulla odio diam, maximus ut libero ut, <span>pharetra ullamcorper</span> orci. Sed magna nisl,
pellentesque at ligula nec, condimentum viverra. Petit texte dโintro sur le forum (juste une idรฉe)?
</p>
</div>
</div>
<?php bbp_get_template_part('user', 'bar'); ?>
<?php bbp_breadcrumb(); ?>
<?php bbp_forum_subscription_link(); ?>
<?php do_action( 'bbp_template_before_forums_index' ); ?>
<?php if ( bbp_has_forums() ) : ?>
<?php bbp_get_template_part( 'loop','forums'); ?>
<?php else : ?>
<?php bbp_get_template_part( 'feedback', 'no-forums' ); ?>
<?php endif; ?>
<?php do_action( 'bbp_template_after_forums_index' ); ?>
</div>
How I can just add a section who display juste the list of the topic for a specific forum ?
Best regards ! ๐
The problem is that themes do not use the wordpress template standards – in many cases for good reasons, but bbpress cannot understand every theme.
I presume you have been here
Step by step guide to setting up a bbPress forum – Part 1
Hi everyone,
Hopefully someone can help me decipher this error (with WP_DEBUG). Without WP_DEBUG simply getting a blank page. Front index and viewing topics works fine, but for some reason the forums (where you see a list of topics) don’t work.
Tried disabling all plugins, besides bbPress of course. Running the latest WordPress version 5.1.
Kind regards,
Jonas.
Fatal error: Uncaught Error: [] operator not supported for strings in /var/www/ukuworld/wp-content/plugins/bbpress/includes/forums/functions.php:1800 Stack trace: #0 /var/www/ukuworld/wp-includes/class-wp-hook.php(286): bbp_pre_get_posts_normalize_forum_visibility(Object(WP_Query)) #1 /var/www/ukuworld/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #2 /var/www/ukuworld/wp-includes/plugin.php(531): WP_Hook->do_action(Array) #3 /var/www/ukuworld/wp-includes/class-wp-query.php(1736): do_action_ref_array('pre_get_posts', Array) #4 /var/www/ukuworld/wp-includes/class-wp-query.php(3387): WP_Query->get_posts() #5 /var/www/ukuworld/wp-includes/class-wp.php(622): WP_Query->query(Array) #6 /var/www/ukuworld/wp-includes/class-wp.php(739): WP->query_posts() #7 /var/www/ukuworld/wp-includes/functions.php(1105): WP->main('') #8 /var/www/ukuworld/wp-blog-header.php(16): wp() #9 /var/www/ukuworld/index.php(17): require('/var/www/ukuwor...') #10 {main} thrown in /var/www/ukuworld/wp-content/plugins/bbpress/includes/forums/functions.php on line 1800
there is, but it is in the code, but in core code that does not have a filter to change.
I could re-write the widget as a new one in a plugin for you, but that would be paid work !
as stated above
You should note that this just magnifies the image, so it will be less defined the bigger you make it.
best I can do without code (I’m just a bbpress user!)
fix is to add this to your custom css
.bbp-logged-in img.avatar {
height: 80px !important;
width: 80px !imprtant;
}
and play with the number. You should note that this just magnifies the image, so it will be less defined the bigger you make it.
the size is hard coded, so can’t be changed
Hello,
BBPress is running great on this site but if a visitor is a guest and clicks a topic to view the content, they are redirected to the home page. We are using WordPress pages with shortcodes to manage the forum.
If you view the sample forum and click the I’m In topic it goes to the home page as guests. We need guests to be able to see the topic info to decide if they want to join.
Any info would be great, here is the page:
<a href=”http://www.raptureintheairnow.com/forums/main-forum/”
Thank you.
This code came with the theme, I dont know how to modify it so that works with specfic categories and/or forums . It Currently shows all categories and forms and sub forums.
ok, try this plugin
bbp blacklist checker
once activated go to tools>bbp blacklist checker
This lets you switch off the code that is causing the issue.
It’s just a bit of testing code, not intended for permanent live use, but may help confirm if it’s bbpress or something behind that is causing the issue.
Try it for both anew post and an edited one
Yes I got that far, not sure how to use modify the following code just for that sepecific category/forum This is the code for the discussion page
<?php
/**
* [g1_bbp_forums] shortcode callback function.
*
* @param array $atts
* @param string $content
* @return string
*/
function g1_bbp_forums_shortcode( $atts, $content ) {
/* We need a static counter to trace a shortcode without the id attribute */
static $counter = 0;
$counter++;
extract( shortcode_atts( array(
‘id’ => ”,
‘class’ => ”
), $atts, ‘g1_bbp_forums’ ) );
// Compose final HTML id attribute
$final_id = strlen( $id ) ? $id : ‘g1-bbp-forums-‘ . $counter;
// Compose final HTML class attribute
$final_class = array(
‘g1-bbp-forums’,
);
$final_class = array_merge( $final_class, explode( ‘ ‘, $class ) );
// Note: private and hidden forums will be excluded via the
// bbp_pre_get_posts_normalize_forum_visibility action and function.
$query = new WP_Query( array(
‘post_type’ => bbp_get_forum_post_type(),
‘post_parent’ => $settings[‘parent_forum’],
‘post_status’ => bbp_get_public_status_id(),
‘posts_per_page’ => get_option( ‘_bbp_forums_per_page’, 50 ),
‘ignore_sticky_posts’ => true,
‘no_found_rows’ => true,
‘orderby’ => ‘menu_order title’,
‘order’ => ‘ASC’
) );
if ( ! $query->have_posts() ) {
return ”;
}
// Start output buffer
ob_start();
?>
<div class=”<?php echo implode( ‘ ‘, array_map( ‘sanitize_html_class’, $final_class ) ); ?>”>
<div class=”g1-collection g1-collection–grid g1-collection–one-third g1-collection–simple”>
<?php while ( $query->have_posts() ) : $query->the_post(); ?>
<li class=”g1-collection__item”>
<article>
<?php if ( has_post_thumbnail() ): ?>
<figure class=”entry-featured-media”>
post->ID ); ?>”>
<?php the_post_thumbnail( ‘g1_one_third’ ); ?>
</figure>
<?php else: ?>
<?php echo do_shortcode( ‘[placeholder icon=”camera” size=”g1_one_third”]’ ); ?>
<?php endif; ?>
<div class=”g1-nonmedia”>
<div class=”g1-inner”>
<header class=”entry-header”>
<h3 class=”entry-title”>
post->ID ); ?>”><?php bbp_forum_title( $query->post->ID ); ?>
</h3>
<p class=”entry-meta g1-meta”>
<span><?php _e( ‘Topics’, ‘bbpress’ ); ?>: <?php bbp_forum_topic_count( $query->post->ID ); ?></span>
<span><?php bbp_show_lead_topic() ? _e( ‘Replies’, ‘bbpress’ ) : _e( ‘Posts’, ‘bbpress’ ); ?>: <?php bbp_show_lead_topic() ? bbp_forum_reply_count( $query->post->ID ) : bbp_forum_post_count( $query->post->ID ); ?></span>
</p>
</header>
<div class=”entry-summary”>
<?php the_excerpt(); ?>
</div>
</div>
</div>
</article>
<?php endwhile; ?>
</div>
</div>
<?php
// Reset the $post global
wp_reset_postdata();
// Return and flush the output buffer
return ob_get_clean();
}
add_shortcode( ‘g1_bbp_forums’, ‘g1_bbp_forums_shortcode’ );