Hello,
When I change the order of topic replies to “ASC” and use the bbPress “show lead topic” code to make sure the lead topic is always the first one, it actually disappears completely (see code below). If I do not add the extra function, is show it on the last page.
This is the code I use to change the order:
function custom_bbp_has_topics() {
$args[‘order’] = ‘ASC’; // ‘ASC’ (Ascending), ‘DESC’ (Descending, Default)
return $args;
}
add_filter(‘bbp_before_has_topics_parse_args’, ‘custom_bbp_has_topics’ );
——————
Then this is what should bring the lead topic to the front. When this code is in place, the lead topic disappears.
function custom_bbp_show_lead_topic( $show_lead ) {
$show_lead[] = ‘true’;
return $show_lead;
}
add_filter(‘bbp_show_lead_topic’, ‘custom_bbp_show_lead_topic’ );
————
Thanks for any help as my client really wants the late replies first after the topic starter.
Alex
Hi,
This question is best addressed to the bbpress author. Our theme does not alter the plugin in any way apart from a bit of css styling from our end. If you want to modify the plugin functionality it’s best to look for the plugin forums or support section.
Thank you!
It actually is part of the theme. Within the bbpress folder within the theme folder, under single topic, you have commented out what should happen when you shoe lead topic:
<div id=”bbpress-forums”>
<?php do_action( ‘bbp_template_before_single_topic’ ); ?>
<?php if ( post_password_required() ) : ?>
<?php bbp_get_template_part( ‘form’, ‘protected’ ); ?>
<?php else : ?>
<?php //bbp_topic_tag_list(); ?>
<?php //bbp_single_topic_description(); ?>
<?php if ( bbp_show_lead_topic() ) : ?>
<?php //bbp_get_template_part( ‘content’, ‘single-topic-lead’ ); ?>
<?php endif; ?>
<?php if ( bbp_has_replies() ) : ?>
<?php //bbp_get_template_part( ‘pagination’, ‘replies’ ); ?>
<?php do_action( ‘bbp_template_before_replies_loop’ ); ?>
—————
I got rid of the // and it worked, except now it is totally styled differently.
Hi,
There is no bbpress folder in our theme, there is only the bbpress.php file that applies the theme style to the plugin. Nothing more. The code you showed in the reply above does not come from the theme but the plugin itself:
http://screencast.com/t/hvd2sCbmy
You can find a few solutions by simply googling it:
https://bbpress.org/forums/topic/reversing-order-of-topic-but-leaving-the-original-topic-at-the-top/
Thank you!
Thank you for the link. It is the exact same one that I found and followed which led to the lead topic disappearing. Attached is a screenshot from the unzipped WP theme files and you can clearly see a bbpress folder, as well as 8 files within that folder. Below is the entire code from that single content php file and you can see the part “if show lead topic” is commented out. Perhaps that has been changed in a more recent update, but I assure you this originated on your end. You can even see the styling in the middle of the php document that is all TagDiv. If you could pleas advice how I can make the lead topic styled properly as it is now being styled by the default bbpress CSS, that would be great. The replies are styled properly.
->> http://pastebin.com/rAEC2cXh
Screen Shot 2016-04-11 at 5.48.01 AM
Thank you,
Alex
Hello alexdobert,
Unfortunately, Bbpress is not part of our theme folder, as Bogdan explained you above, sorry! Please check this folder -> http://screencast.com/t/nRB0IIGV. Here you can see all the plugins that come bundled with our theme. Please notice that we cannot provide support for this kind of plugin and I suggest you to address to the author’s plugin because he should be able to guide you in the right direction and this is not theme related, sorry!
Thank you for your understanding!
I’m sorry to be a stickler about this and at this point I am no longer looking for support, however, I can’t help but wonder if you are even reading my entire post or looking at my screenshot. The screenshot (link below again) clearly shows that there is a bbpresss folder FROM THE ORIGINAL DOWNLOAD OF THE THEME in the root folder. And if you look at the code of “content-single-topic.php” within that folder, you will see the following code. I am again highlighting the code that makes is clear that it was written by TagDiv since it is referring to td classes:
<?php
//single topic
/**
* Single Topic Content Part
*
* @package bbPress
* @subpackage Theme
*/
?>
<div id=”bbpress-forums”>
<?php do_action( ‘bbp_template_before_single_topic’ ); ?>
<?php if ( post_password_required() ) : ?>
<?php bbp_get_template_part( ‘form’, ‘protected’ ); ?>
<?php else : ?>
<?php //bbp_topic_tag_list(); ?>
<?php //bbp_single_topic_description(); ?>
<?php if ( bbp_show_lead_topic() ) : ?>
<?php //bbp_get_template_part( ‘content’, ‘single-topic-lead’ ); ?> <———- COMMENTED OUT!
<?php endif; ?>
<?php if ( bbp_has_replies() ) : ?>
<?php //bbp_get_template_part( ‘pagination’, ‘replies’ ); ?>
<?php do_action( ‘bbp_template_before_replies_loop’ ); ?>
<?php
?>
<ul class=”td-reply-list-header”>
<li class=”td-posted-in”>Posted in: “><?php bbp_forum_title(bbp_get_forum_id());?>
<li class=”td-favorite-subscribe”>
<?php bbp_user_favorites_link(); ?>
<?php bbp_user_subscribe_link(); ?>
<?php while ( bbp_replies() ) : bbp_the_reply(); ?>
<div class=”td-reply”>
<div class=”td-reply-author-thumb”>
<?php bbp_reply_author_link( array(‘show_role’ => true, ‘type’ => ‘avatar’, ‘size’ => 50 ) ); ?>
</div>
<div class=”td-reply-desc”>
<div class=”td-reply-header”>
<!– author –>
<div class=”td-reply-author”>
“><?php bbp_reply_author_display_name() ?>
</div>
<!– permalinks and post controls –>
<div class=”td-reply-controls”>
” class=”bbp-reply-permalink”>#<?php bbp_reply_id(); ?>
<?php do_action( ‘bbp_theme_before_reply_admin_links’ ); ?>
<?php bbp_reply_admin_links(); ?>
<?php do_action( ‘bbp_theme_after_reply_admin_links’ ); ?>
</div>
</div>
<!– comments –>
<div class=”td-reply-content”>
<span class=”bbp-topic-post-date”><?php bbp_reply_post_date(); ?></span>
<?php bbp_reply_content(); ?>
</div>
<?php if ( bbp_is_user_keymaster() ) : ?>
<?php do_action( ‘bbp_theme_before_reply_author_admin_details’ ); ?>
<div class=”bbp-reply-ip”><?php bbp_author_ip( bbp_get_reply_id() ); ?></div>
<?php do_action( ‘bbp_theme_after_reply_author_admin_details’ ); ?>
<?php endif; ?>
</div>
</div>
<?php endwhile; ?>
<?php do_action( ‘bbp_template_after_replies_loop’ ); ?>
<?php bbp_get_template_part( ‘pagination’, ‘replies’ ); ?>
<?php endif; ?>
<?php bbp_get_template_part( ‘form’, ‘reply’ ); ?>
<?php endif; ?>
<?php do_action( ‘bbp_template_after_single_topic’ ); ?>
</div>
At this point I do not care for any support, but do not tell me that I am mistaken and that the bbpress plugin or I put that folder into theme root. There is a screenshot of the never touched unzipped newspaper theme and you can clearly see a bbpress folder in it! I will concede that it is perhaps confusing and that there is an update where that folder no longer exists or was moved, but in my case, when I purchased and downloaded and installed the theme, it did! All I was really asking was how the style the lead topic the same as the replies, which your theme does! You can even see the td classes that are being called right in the PHP. I would think that it would be an easy fix, but since you guys don’t even believe what I am saying, I will figure this out on my own.
http://www.screencast.com/t/sIQJgjwtG
Thanks,
Alex
Hello,
This has been a great misunderstanding. We were talking about 2 very different versions of the theme. In newspaper 4 there really were those files in the root folder, but that was a quite a long time ago and the code was since then changed entirely. Sorry for the misunderstanding. I should have asked about the version you use as the code looks totally different now and that part is nowhere to be found in newspaper 6.
Here is a simple solution to this issue. Thre is a plugin that already does this and is called: https://wordpress.org/plugins/bbpress-sort-topic-replies/. This will add an extra field to the forum with a sorting order for the replies: http://screencast.com/t/Qtj8Y3nUC29L
If you do not want to use the plugin, maybe you can replicate the code used there and implement it in the files directly.
I hope this helps and sorry for the inconvenience.
Thank you!