How about this plugin?
function front_page_topics() {
$bb->page_topics = 10;
}
add_action( 'bb_index.php_pre_db', 'front_page_topics' );
I am not sure what you mean by that, as I have never created a plug-in before. Anways, I gave it a try as follows:
Created a blank file with the following content:
<?php
function front_page_topics() {
$bb->page_topics = 2;
}
add_action( ‘bb_index.php_pre_db’, ‘front_page_topics’ );
?>
Then saved it as “latest-posts.php” and stored it in my newly created “my-plugins” folder.
But it did not seem to have any effect as the front page of the forum would still display more that 2 latest posts (I selected to limit the topics to 2 so it would be asier to test).
The only other thing I can think of is that this code needs to instead be added to one of the regular scripts, but I have no idea which one.
thanks,
thomas
Oops, my fault. Do exactly what you did but put
global $bb;
directly under the function
line.
<?php
function front_page_topics() {
global $bb;
$bb->page_topics = 2;
}
add_action( ‘bb_index.php_pre_db’, ‘front_page_topics’ );
?>
That works perfectly. Thanks!
Works for me too. Thanks to both of you!
NO, wait when I try to open the tags.php I recieve this message:
Warning: Cannot modify header information - headers already sent by (output started at /home/username/public_html/forum/my-plugins/latest-topics.php:9) in /home/username/public_html/forum/bb-includes/functions.php on line 1304
TIA
Make sure there is no whitespace (spaces, extra lines, tabs, etc.) before the <?php
in your plugin nor after the ?>
Thanks, you were right on the money!
Would anyone happen to know if this still applies to version 0.8? I have a new forum I’d like to try this in but I thought I’d check to make sure it wouldn’t break anything first. Or is there another method that would work better?
thanks!
Looking it over, I can’t see any reason why this won’t work. I guess test it out and if you get and error, just delete the plugin and report back here!
Trent
That version of the plugin should work fine, but the most recent version (Front Page Topics 0. is a bit more configurable.
https://bbpress.org/plugins/topic/3
I tried it and everything seems to be running smoothly, thanks again for the quick response!
Hey, thanks for the tip, mdawaffe. That was a breeze!
mdawaffe’s plugin isn’t as cool as mine
https://bbpress.org/plugins/topic/21?replies=1
j/k about mine being cooler, but it may work in a way that you like better