Forum Replies Created
-
I got in contact with @shanhard but basically copied most of my code from wp-content/plugins/bbpress/includes/common/widgets.php
In reply to: Check if on page/blog or forumI had to read better. It was in the Codex is_page() function reference.
Had to reset the query after the loop:
wp_reset_query(); // and after that:
if(is_page()){ // etc.In reply to: Check if on page/blog or forumThanks, but it needs to give different results for the SAME topic on different ‘pages’. When it displays below an article vs it’s own page.
In reply to: Displaying Adsense adsVery quick response, think this or something like this would work:
Create a child theme, copy loop-replies.php and change this part:
<?php while ( bbp_replies() ) : bbp_the_reply(); ?> <?php bbp_get_template_part( 'loop', 'single-reply' ); ?> <?php endwhile; ?>
into:
<?php $i=1; while ( bbp_replies() ) : bbp_the_reply(); ?> <?php if(1==$i or 3==$i) { echo '#adsense code#'; } ?> <?php $i++; ?> <?php bbp_get_template_part( 'loop', 'single-reply' ); ?> <?php endwhile; ?>
Great!
You should read something about responsive webdesign. Easiest way to make a mobile site is to adjust the way users view the page with css.
You can add all sorts of changes to your theme or bbpress from the general wordpress functions.php file. You can find this file here:
/wp-content/themes/%theme name%/functions.phpBut if you update your theme your changes to this file will be overwritten, that’s why you should make a child theme with your own functions.php file. It’s not that hard and after you’ve made your child theme it’s easy to tweak other things as well.
You could just put it in your functions.php file.
If it’s empty put this on the first line:
<?php
General information about adjusting your theme (and functions.php): Making a child theme
@jslom I think I used something from this thread: https://bbpress.org/forums/topic/add-a-featured-image-to-a-forum/
In reply to: Forum rootI read a lot of questions about what to do with the forum root, so I figured I post something other might use as well. My workaround:
– I made a page with all my forum categories, like I described above.
– The forum root uses the bbpress.php template and in that file I made an if statement to check if the template is serving the forum-root. If that happens the template shows the last 25 active topics.
– Both pages have a header like this:
—————
Forum
| Sorted on category | Active topics |
—————
That way it’s very obvious how to go to the counter-page.Breadcrumbs now direct to the last active topics page, while the ‘forum’ link in my top navigation directs to the forum page (sorted on subject). Not perfect, but it’s the best I could think of.
Any further help / suggestion are appreciated!
Results:
http://www.24baby.nl/community/ (last active)
http://www.24baby.nl/forum/ (on category)You could change your forum lay-out with a template and let your other pages stay the same. It’s going to be though to achieve this result without ANY coding languages. Even when you use other’s code you’ll need to change the .css to change the colors etc.
If you however decide to try it yourself, you should start reading here.
Thanks Shmoo!
I added this filter, don’t remember where I found it:function short_freshness_time( $output) { $output = preg_replace( '/, .*[^ago]/', ' ', $output ); return $output; } add_filter( 'bbp_get_time_since', 'short_freshness_time' ); add_filter('bp_core_time_since', 'short_freshness_time');
Shall we leave this thread to Mycelus now? Feel free to PM me or open your own.
I would show a little more appreciation for the people making all of this possible.
That being said, this is my bbpress forum: 24Baby (dutch). Looks exactly like the two you linked to. I would be happy to provide some code, but before I put any effort into it, please make sure bbpress is the forum software of your choice.
In reply to: Forum rootHmm this looks like a bug. I just posted this topic, but it’s not in the recent topics list and on my profile it has a freshness of 1 year and 6 months. Think it’s the slug. So BUMP 😉
In reply to: Duplicate Page Titlesedit, nevermind. Should have posted on Buddypress forum
In reply to: Remove default cssThanks a lot!
In reply to: layout changesIt’s all quite easy once you understand the structure. Don’t expect to click some buttons though, if you want to make real changes to the default layout you’ll need some basic knowledge of HTML and php.
In reply to: Freshness of the forums list as a normal dateThis should get you started: bbp_get_reply_post_date on sourcexref
I feel the same way. It’s great how much work is being put into this plugin, but the support isn’t great. And finding out what information is still valid for the current bbpress version is sometimes difficult.
But in general: you could google every function and after a few days you’re used to and can guess the very logical named function names.
Good luck. (and keep me updated)
In reply to: Wanted to remove sidebar from bbPress 2.4To me it seems it all works perfectly. Just add
.two_third { width: 100%; }to your .css file
In reply to: Wanted to remove sidebar from bbPress 2.4Hey.
If you haven’t created a child theme, start with doing that.
Create the file bbpress.php in your child theme.
Copy the content of your page.php file into this new file.
Remove the line<?php get_sidebar(); ?>
You’ve removed the sidebar 🙂
Now you only need to change / add some classes / ID’s and adjust your CSS file to give the forum a 100% width.
Keep me updated 🙂
In reply to: Back to forum after logging inThis might help you.
In reply to: bbp_rel_nofollowI only know a little php, and I think this way the function searches through ALL the links in a reply/topic and adds target_blank to all of them when at least one of them is external. That’s not what you want.
You need to
1) explode the content
2) loop through all link tags
3) Test if it’s external or internal
4) if external: use the function above to add the target=_blank
5) if internal: remove nofollow
6) implode and return the new reply/topic content.It would probably take me a few hours to google this together, maybe you could try this yourself or somebody whit a little more php knowledge could help.
In reply to: bbp_rel_nofollowUsing bbp_rel_nofollow as a starting point is obviously better 😉
In reply to: bbp_rel_nofollowYou don’t have to change the bbp_rel_nofollow filter, just add another filter like this in your functions.php:
<?php
add_filter( ‘bbp_get_reply_content’,’links_blank_follow’, 90 );
add_filter( ‘bbp_get_topic_content’,’links_blank_follow’, 90 );function links_blank_follow() {
// add nofollow or target blank to links
}
?>As for the function itself, I wouldn’t know how to do that, but you should be able to put it together, could start here.
Let me know!
In reply to: Remove hyperlink from user nameI haven’t got a clue what that problem might be, I’m sorry. Did you upload a valid functions.php in between your different tries (with/without <?php ?>) ?
(and yes, I see my code could be a little shorter, feel free to optimize this :))