The following is what I use at AppGlobe:
/* Add Google+ profile URL as profile contact method */
function appglobe_add_google_profile( $contactmethods ) {
$contactmethods['google_profile_url'] = 'Google Profile URL';
return $contactmethods;
}
add_filter( 'user_contactmethods', 'appglobe_add_google_profile', 10, 1);
/* Remove nofollow, and ad author to the profile link */
function appglobe_switch_nofollow_for_author($str) {
$str = preg_replace(
'~<a ([^>]*)\s*(["|\']{1}\w*)\s*nofollow([^>]*)>~U',
'<a ${1}${2}${3}>', $str);
return str_replace(array(' rel=""', " rel=''"), 'rel=author', $str);
}
add_filter( 'bbp_get_topic_author_link', 'appglobe_switch_nofollow_for_author' );
And then in your user-profile.php (create a bbpress folder in your theme root, and copy it over) you can add this:
<?php if( bbp_get_displayed_user_field( 'google_profile_url' ) ) : ?>
<h2 class="author-subtitle">Google Profile</h2>
<?php if( bbp_get_user_role(bbp_get_displayed_user_id()) == 'bbp_keymaster' || bbp_get_user_role(bbp_get_displayed_user_id()) == 'bbp_moderator') : ?>
<a rel="me" class="bbp-user-url" href="<?php esc_url(bbp_displayed_user_field( 'google_profile_url' )); ?>"><?php bbp_displayed_user_field( 'google_profile_url' ); ?>
</a>
<?php else : ?>
<a rel="me nofollow" class="bbp-user-url" href="<?php esc_url(bbp_displayed_user_field( 'google_profile_url')); ?>"><?php bbp_displayed_user_field( 'google_profile_url'); ?>
</a>
<?php endif; ?>
Since I beleave only the first rel=me link on a page counts there would be best to use topic lead:
add_filter( 'bbp_show_lead_topic', '__return_true' );
…by doing so each page will be considered authored by the topic creator even if its paged.
To all those smart coding guys out there, please can someone help me with the bbP functions needed to complete the code below. I think there are two bbP functions needed – see square brackets [??…]. Or maybe someone has a better way of doing it.
I’m trying to integrate BP1.6.1, the new bbP2.2.2 forums and WordPress SEO1.3.1.1 so that the WordPress SEO (meta) page titles are shown when a bbP Topic is being shown within a BP page (just like they are shown for native bbP forum pages).
I’ve hooked functions into ‘bp_modify_page_title’ before and managed to extract ‘_yoast_wpseo_title’ before. So I’m part way there I guess.
I also understand that I need to change the priority from 10 to 16 (or more) in line below (in buddypress>bp-core>bp-core-filters.php), to make bp_modify_page_title filter execute after, and hence overrule, WPSEO title which has priority 15 (in worpress-seo>frontend>class-frontend.php).
add_filter( ‘wp_title’, ‘bp_modify_page_title’, 16, 3 );
add_filter( 'bp_modify_page_title', 'new_page_title', 10, 4 );
function new_page_title( $new_page_title, $title, $sep, $seplocation ) {
global $bp, $bbp;
/** If bbP Topic is being shown within a BP page then replace title with title input via Yoast WordPress SEO plugin */
if ( [?? a bbp function that is true when bbP Topic is being shown within a BP page] && bp_is_active( 'groups' ) && !empty( $bp->groups->current_group ) ) {
[?? a bbp function that loads the bbP Topic Post ID to $topic->ID];
$new_page_title= get_post_meta( $topic->ID, _yoast_wpseo_title, true);
}
return $new_page_title;
}
If you can help please, and I can then get this to work, I’ll post the result back again so others can benefit.
Many thanks.
If you know CSS you can easily add some styles to your to style sheet. If you use the default templete, it could look like this:
.bbPress.forum .entry-title {
/*Styles to add icon image to the left of this element goes here*/
}
Well, this is the logs from the time I activated the plugins:
20121207T212805: www.conatu.net/wp-admin/admin-ajax.php
PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 77824 bytes) in /hermes/bosoraweb064/b1399/ipg.conatunet/wp-includes/class-simplepie.php on line 3743
20121207T212805: www.conatu.net/wp-admin/admin-ajax.php
PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 77824 bytes) in /hermes/bosoraweb064/b1399/ipg.conatunet/wp-includes/class-simplepie.php on line 3743
20121207T212806: www.conatu.net/wp-admin/admin-ajax.php
PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 77824 bytes) in /hermes/bosoraweb064/b1399/ipg.conatunet/wp-includes/class-simplepie.php on line 3743
20121207T213434: www.conatu.net/wp-admin/admin-ajax.php
PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 77824 bytes) in /hermes/bosoraweb064/b1399/ipg.conatunet/wp-includes/class-simplepie.php on line 3743
20121207T213434: www.conatu.net/wp-admin/admin-ajax.php
PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 77824 bytes) in /hermes/bosoraweb064/b1399/ipg.conatunet/wp-includes/class-simplepie.php on line 3529
20121207T213436: www.conatu.net/wp-admin/admin-ajax.php
PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 77824 bytes) in /hermes/bosoraweb064/b1399/ipg.conatunet/wp-includes/class-simplepie.php on line 3529
And btw, from where can I make forums?
I’m having the exact same problem. And like ffalder I can’t code, but usually Google my way out of a problem. But this time no luck.
From my research it seems lots of people are having the same problem.
I think the main issue here is the breadcrumbs.
1) You create a custom ‘forum home page’ using short codes (or whatever means you like) to be your default page that users see as the homepage of your forum.
2) A user try’s to get back to the ‘forum home page’ using the breadcrumbs by clicking the text “forums” in the breadcrumbs.
3) Unfortunately it just redirects to the forum slug chosen in Settings, not your actual ‘forum home page’. And that forum slug is always defaulted to an archives page.
4) So setting that slug to the same as your ‘forum home page’ does not work, because woprdpress overrides your ‘forum home page’ created in step 1 and defaults it to an archives page.
Sorry for re-hashing this, but it’s sometimes better to make it a little clearer. At least in my own head anyway.
I don’t know how simple this is or not, but one solution that comes to mind is to have an option in Settings that lets you decide where the ‘forums’ text link in the breadcrumbs will point to. If you can choose to have it point to your ‘forum home page’ then all would be solved right?
This person suggested changing the breadcrumbs in the core of the plugin, but obviously it’s not very desirable since it’s changes to the core. And I also cannot find the file that they edited. Think it might have been a mod to an old version: http://mysitemyway.com/support/topic/infocus-bbpress-20-root-slug
It should be possible with some custom code tweaks. Are you comfortable with a little PHP?
Since I wan’t only replies ( not created topics and replies) I’ve created a filter function:
function ag_force_replies_only( $query, $user_id ) {
if( bbp_is_single_user() ) { // Just in case
$query = bbp_has_replies( array(
‘post_type’ => array( bbp_get_reply_post_type() ),
‘post_parent’ => ‘any’,
‘posts_per_page’ => bbp_get_replies_per_page(),
‘paged’ => bbp_get_paged(),
‘orderby’ => ‘date’,
‘order’ => ‘DESC’,
‘author’ => $user_id,
‘show_stickies’ => false,
) );
}
return $query;
}
add_filter(‘bbp_get_user_replies_created’, ‘ag_force_replies_only’, 10, 2);
Now is shows replies only: http://appglobe.com/forums/users/martin/replies/
Have you followed the Import Forums guide on the Codex? If so; where did you get stuck?
Making a child theme is beyond the scope of this forum, but there are plenty of good resources if you google “create a wordpress child theme”. In a nutshell, you need “at least” to have a new folder, with a style.css file that references the proper header elements of your parent, including its name and the location of the parent theme’s style sheet.
If you are using the shortcode method, please try the default method instead, which is to change bbPress’s default root slug to something that is “NOT” an existing page (try “sitewide-forums” for example). This will allow you to keep your existing page / shortcut method index. Please show us what happens when you do this? (provide the URL)
You have several issues going on here, but they are directly related to your theme. As is very common, it appears to me that your theme has a conditional statement in the template file that builds archive pages. As such, it’s treating the content for bbPress forums as excerpts, as well as applying some unwanted styling.
Have you tried to build a page using the shortcode method? If so, what was the result? If you found it worked properly, then the issue as suggested above, and you could try to modify your theme or child-theme files to add a similar conditional that looks for bbPress and forces it to use the_content() instead of the_excerpt(). See: https://bbpress.org/forums/topic/non-functional-index-page-when-bbpress-2-1rc4-is-used-with-woothemes-canvas-5-05/
If this page is being built with shortcodes (I don’t think it is from what I see) then what is the result if you try the default forum index method? We outline both methods in our step by step video here: http://labzip.com/the-definitive-guide-to-buddypress-bbpress-configuration/
We’ll get you there… 😉
What is your site url? I can give you some suggestions on where to place the code for a login-box so it shows up on the top of a page.
Also, if you prefer, you can build your forum site index using shortcode / page method… this would give you flexibility of having your default theme sidebar, etc. available to you.
Not sure? Check out our updated step by step guide that covers the two methods for creating a forum index page:
http://labzip.com/the-definitive-guide-to-buddypress-bbpress-configuration/
Cheers!
spence
Hi Ishr,
In Stephen Edgar’s reply that I linked to he posted a link to a gist on GitHub. Place the code he referenced in your child theme’s functions.php file.
Make sure to backup that file before editing it just in case something goes wrong and you can easily revert.
I understand widgets and sidebars but I how is
/forums/ rendered. It is not a page, post or blog. I don’t understand how to add a sidebar to this.
My work around is to create a PAGE and add the forumns via a shortcode but it seems like there should be an option to add to /forums/ (of course I am sure I am missing something simple)
Fundamentally you need to understand that the use of the prefix is designed to put a unique prefix in place when you’re on a forum index page vs when you are on a topic index page. As such, it is not possible with the default code to show “/forum/topic” if ou mean both are prefixes.
I suggest you use the plural term “forums” as your base, then “forum” and “topic” as your prefixes.
If you like, have a watch of our comprehensive guide video:
The Definitive Guide To BuddyPress & bbPress Configuration
cheers!
spence
I understand using the short codes and setting up a PAGE that includes the username login box. …but is there a way to add the username login the default forum. I have my forumn set to the default location /forums/ and I’d like to add the username/password login to this page (in the right sidebar). Is there an easy way to do that?
What about using the ‘Login Widget’ https://codex.bbpress.org/widgets/
Or one of the ‘account’ shortcodes? https://codex.bbpress.org/shortcodes/
Couldn’t you achieve this using bbPress’ shortcodes? Namely; [bbp-forum-index]
I’m having this exact same problem. Unfortunately my WordPress page does not win when I set them to the same slug. Because of this, I want to use different slugs for my WordPress page that contains the shortcode and my Forums Base. This works just fine, the only problem is in the breadcrumb the “Forums” link takes the user to the forum index instead of the WordPress page with the shortcode.
If anyone has any ideas I’m working on this issue on Stack Overflow as well. I think I’ve done a better job explaining it there and getting some good code put together from contributors but haven’t reached the finish line.
MySQL query help moving data between tables
Hi
I have a wordpress(3.4.1) installation and I don’t use standard WordPress
Authentication. I have my own login page(mylogin.php) where I capture the
userid/password and then compare with values in my own user table.
Now I am using BBPress plugin(2.2.2). I have created a page(askanexpert) in
wordpress and inside that page I have put the BBPress shortcode [bbp-forum-index].
Now from frontend when the user does login and go to forum(http://www.domainname.com/askanaexpert),
bbpress forum is visible and all the topics are visible, but forum shows the message that
“You must be logged in to create new topics.”
I think it happens because BBPress is perhaps looking for some authenticated cookie which
was not created due to my custom authentication.
Is there a way to create the cookie from my custom authentication page, which
bbpress will understand ?
I can not get rid of my custom authentication. Is there a way to fix it, so that when user is
logged in to wordpress site he/she can use the forum as regular logged in user without login again?
I am fine to do some programming, but not sure which way to go.
I’m looking for the correct method to dequeue bbpress css from the plugin directory and also that of the css folder within the theme.
The entire site is much larger than just the forum and I really don’t want to call the css for every page as most people don’t have a need to access the forums. I’ll then enqueue the css with is_bbpress combined with is_page(array for the 2 pages that contain shortcodes.
I need to make sure that it dequeues from both locations as there is a custom css being used.
Thanks in advance for the help!
I am currently manipulating with the function that was posted on forums a few days ago and I can’t find a way round a funny issue.
I erased homepape as a first part of my breadcrumb.
There are two options right now and neither are working for me. I will present it underneath (bold means clickable). I either get this
forum>forum | forum>category1 | forum>category1>topic
or this:
forum | forum | forum>category1
I want:
forum | forum>category1 | forum>category1>topic
or this:
(nothing) | forum | forum>category1
Any ideas?
The function I’m trying to get to work is diplayed below
function mycustom_breadcrumb_options() {
// Home - default = true
$args['include_home'] = false;
// Forum root - default = true
$args['include_root'] = true;
// Current - default = true
$args['include_current'] = true;
return $args;
}
I would like to display a ‘New Topic’ form at the bottom of my posts with the [bbp-topic-form] shortcode . When someone publish a topic through this form (inside a regular WP post), I would like to save a post_meta for the regular WP ID post that bind the new topic ID with the post ID.
Someone could me suggest an action to hook ?