Hello,
I’m trying to setup a full-width template for all group pages.
According to the documentation you can put a theme file (single.php) in
/wp-content/themes/twentyfourteen-child/buddypress/groups/
but my group pages are not picking up the template.
What am I doing wrong?
Thanks
This my index.php:
<?php
/**
* Template Name: Full Width Page
*
* @package WordPress
* @subpackage Twenty_Fourteen
* @since Twenty Fourteen 1.0
*/
get_header(); ?>
<div id="main-content" class="main-content">
<?php
if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
// Include the featured content template.
get_template_part( 'featured-content' );
}
?>
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php
// Start the Loop.
while ( have_posts() ) : the_post();
// Include the page content template.
get_template_part( 'content', 'page' );
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) {
comments_template();
}
endwhile;
?>
</div><!-- #content -->
</div><!-- #primary -->
</div><!-- #main-content -->
<?php
get_sidebar();
get_footer();
I am using some drop-down select boxes for users to make choices when editing their account pages. When a user makes a choice and submits the form, that choice is reflected in my admin; however, if the user navigates back to edit their account, the option they chose in the drop-down is no longer displayed, instead replaced by either the default value or a blank entry if no default has been chosen.
How can I ensure that, once a user makes a selection, they will always see that selection in future sessions, essentially overriding the system default value?
I am using WP 4.2.5 and BuddyPress 2.3.3. I am currently developing locally so I can’t send a link.
Hello! 🙂
Is there a way to create a WP account but not automatically a BuddyPress profile?
Thank you.
Full disclaimer: I’m not much of a programmer; more of a front end guy who gets by on the back end with trial and error. This one is above my skill level, however.
I am using BuddyPress’ Profile Fields in conjunction with WPMUDev’s Membership 2 Pro plugin. I’ve created some new Profile Fields that I also want to be displayed on a user’s account page. I’ve found the file that needs to be updated; currently, the code displaying the default membership attributes looks like this:
public function prepare_fields() {
$fields = array(
‘personal_info’ => array(
‘first_name’ => __( ‘First name’, MS_TEXT_DOMAIN ),
‘last_name’ => __( ‘Last name’, MS_TEXT_DOMAIN ),
‘username’ => __( ‘Username’, MS_TEXT_DOMAIN ),
’email’ => __( ‘Email’, MS_TEXT_DOMAIN ),
)
);
When I add new Profile Fields in BuddyPress, they show up as fields that users can edit within their profile but they don’t automatically display in this array. I can see how to add new fields to the list:
‘value_of_XXXX’ => __( ‘XXXX’, MS_TEXT_DOMAIN ),
I just don’t know how to find the value of XXXX once I have created that field within BuddyPress. I have posted the same question in the WPMUDev forum but so far don’t have an answer.
I am using WP 4.2.5 and BuddyPress 2.3.3. I am currently developing locally so I can’t send a link.
Thanks in advance.
The best place to learn how BuddyPress works is the codebase. Over the past few years, the inline docs have been improved tremendously and are now at a point where they’re very useful.
Hi,
I want to display the events that a buddypress user has submitted on their profile page under their profile fields.
I tried to make a custom shortcode based on some stuff found in the forums but it displayed all events, here is the code for that
function custom_shortcode(){
$user_id = get_the_author_meta( 'ID' ); //returns id of user profile
return do_shortcode( '[eo_events author='.$user_id.']' ); }
add_shortcode( 'eo_custom_shortcode', 'custom_shortcode' );
I then displayed the shortcode in profile-loop.php like this:
/** This action is documented in bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php */
do_action( 'bp_after_profile_loop_content' ); ?>
<h5 class="event_profile_title_random"> Upcoming Events & Deadlines... </h5>
<div id="event_profileinfo_random"> [eo_custom_shortcode] </div>
This works when I specify a fixed know user id but is not working dynamically. I guess get_the_author_meta() is being used wrong. Do I need to use it inside profile-loop.php instead? I have tried this with no luck. COuld someone help me out? I am a php begineer trying to learn! thanks so much for your help!
https://buddypress.org/support/topic/make-your-own-custom-buddypress-page/.
The snippet I found in the above link is as below:
define('BP_EXAMPLE_SLUG', 'fun');
function bp_show_example_page() {
global $bp, $current_blog;
if ( $bp->current_component == BP_EXAMPLE_SLUG && $bp->current_action == '' ) {
// The first variable here must match the name of your template file below
bp_core_load_template( 'fun', true );
}
}
add_action( 'wp', 'bp_show_example_page', 2 );
Sorry the link is Link. My mistake
In buddypress, activity, members, group have a definite pages like ‘domain/activity’, ‘domain/members’, ‘domain/group’, respectively. Likewise I’m trying to create my own custom page like ‘domain/mycustom’.
For this purpose I referred John James Jacoby’s Post in here. The snippet used in that link didn’t work for me. I don’t know where I’m missing.
From that snippet, I found that $bp->current_component returns me an empty string.
@danbp : Thank You very much for your reply.
Even I’ve tried bp_current_component() and bp_is_current_component() functions with no success.
Actually this function works fine when used in default buddypress pages like domain/activity/. This returns me “activity”, which is exactly correct. But when I tried this in my custom page (domain/custompage), I’m getting an empty string.
When looking at an individual users profile, the “view” link that directs to their recent activity points to my-domain/activity/p/127 but when I click on it the link directs me to a totally non-related page on my site.
This is happening with every “view” link throughout the site and always directs to the same non-related page.
Also, when I am viewing an individual users profile, the “Activity” link points to my-domain/members/username/activity/. But when I click on the link it directs me to the Site Wide Activity located at my-domain/activity/
I am running:
Tempera Theme – I am using a child-theme
Wordpress 4.3.1
bbPress 2.5.8
BuddyPress 2.3.3
BuddyPress NoCaptcha Register Box 1.1.3
Membership2 4.0.0.5
Nextgen Gallery 2.1.15
I have tested with only WordPress and Buddypress activated with same results.
This is a clean install and I have tested with TwentyFifteen theme with same results.
I’ve got the same problem. My installed theme is KLEO. I don’t know how but when I installed the same KLEO and related plugins on my PC’s localhost. The register/activate pages of BuddyPress v2.3.3 DID APPEAR! I opened both online and localhost pages on the same browser Google Chrome. How weird!
BTW, I guess we have to create the pages manually.Thanks @danbp for your reply
@swissprice – There are several “chat” plugins what “work with wordpress / buddypress” – it would be easy to establish a group chat room that allows registered and non-registered users to chat with each other via the main chat room – and they can private message each other there.
As far as “begin chat with this user” – I think you would need something that says “User A” is online now – and a setting that would allow a non-registered, non-logged in person to send a “message”. I think I saw a thread a while back where someone was trying to adapt the “single user profile page” to allow guest comments, aka activity post on that profile / user’s activity page..
Not sure exactly what you are going for here.
@edoescad you might have more luck creating your own post herehere
I’m not a developer, in fact this was my first ever post on bp.org so I can’t help you on this… 🙂
I was trying to find a place in the documentation where everything was laid out in groups. Is there anywhere on buddypress.org where the functions are organized and easy to find. I really want to start using BuddyPress, but the documentation is very poorly organized on the site.
Any suggestion, I’ve done a lot of looking around and have not found anyone having a similar problem!
I have double checked that under Screen Options: BuddyPress is enabled, obviously. The plugin is active and I do not know of any errors. I have no idea as to why none of the menu items are appearing.
I am trying to add buttons to my menu that are dynamic links to buddypress items. Since logging into wordpress and updating some plugins a few days ago all of the buttons are all of a sudden missing.
I have a screenshot to help explain what my issue is:
http://postimg.org/image/e0f9fdb2r/
Any suggestions are appreciated! Thanks (:
When you mention a member in a blog comment, that member is informed of that on is profile notification screen and via the notif bubble in user menu (top right under howdy). But no mail is send in this case.
May be related topics:
https://buddypress.org/support/topic/no-notifications-for-mentions-in-comments/
https://buddypress.org/support/topic/notifications-component-fixing-custom-templatestemplates/
Also:
bp_notifications_add_notification
No. You have to create Activate/Register pages manually.
Configure BuddyPress
hi @bigkahunaburger,
Give this a try (goes to bp-custom.php or child-theme functions.php)
function bpfr_get_user_comments_on_profile() {
// number of comments to show per page
define( 'DEFAULT_COMMENTS_PER_PAGE', 3 );
$page = (get_query_var('page')) ? get_query_var('page') : 1;
$limit = DEFAULT_COMMENTS_PER_PAGE;
$offset = ($page * $limit) - $limit;
$param = array(
'user_id' => bp_displayed_user_id(),
'status' => 'approve',
'offset' => $offset,
'number' => $limit
);
$total_comments = get_comments(array(
'orderby' => 'comment_date',
'order' => 'ASC',
'status' => 'approve',
'parent' => 0
));
$pages = ceil(count($total_comments)/DEFAULT_COMMENTS_PER_PAGE);
$comments = get_comments( $param );
$args = array(
'base' => @add_query_arg('page','%#%'),
'format' => '?page=%#%',
'total' => $pages,
'current' => $page,
'show_all' => false,
'mid_size' => 4,
'prev_next' => true,
'prev_text' => __('« backward'),
'next_text' => __('onward »'),
'type' => 'plain'
);
// Output pagination
echo paginate_links( $args );
?>
<ul>
<?php
foreach($comments as $comment) {
// short version
//echo '<li>'. ($comment->comment_content .' <a href="'. esc_url( get_permalink( $comment->comment_post_ID ) ) ).'">View post</a></li>';
// long version
echo '<li>'. ($comment->comment_content .' <a href="'. esc_url( get_permalink( $comment->comment_post_ID ) ) ).'">'. get_the_title( $comment->comment_post_ID ) .'</a> Comment: '. get_comment_date( '', $comment ) .'</li>';
}
?>
</ul>
<?php
}
add_action ( 'my_profile_comment', 'bpfr_get_user_comments_on_profile' );
function bpfr_comment_profile_setup_nav() {
global $bp;
$parent_slug = 'comments';
$child_slug = 'comments_sub';
// Add nav item
bp_core_new_nav_item( array(
'name' => __( 'My comments' ),
'slug' => $parent_slug,
'screen_function' => 'bpfr_profile_comment_screen',
'position' => 40,
'default_subnav_slug' => $child_slug
) );
//Add subnav item
bp_core_new_subnav_item( array(
'name' => __( 'My latest comments' ), // as content title
'slug' => $child_slug,
'parent_url' => $bp->loggedin_user->domain . $parent_slug.'/',
'parent_slug' => $parent_slug,
'screen_function' => 'bpfr_profile_comment_screen'
) );
}
function bpfr_profile_comment_screen() {
add_action( 'bp_template_content', 'bpfr_profile_comment_screen_content' );
bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
}
function bpfr_profile_comment_screen_content() {
do_action( my_profile_comment );
}
add_action( 'bp_setup_nav', 'bpfr_comment_profile_setup_nav' );
Reference: https://codex.wordpress.org/Function_Reference/get_comments
To do the same for user’s post, see here:
https://buddypress.org/support/topic/creating-a-custom-tab-that-takes-in-the-info-from-wp-recent-posts/
I haven’t been able to get the Activate and Register pages to work with the Genesis Executive Pro theme. I’ve done quite a bit of research and it doesn’t seem clear to me on whether BuddyPress creates its own Activate and Register pages or these are pages I need to create. We were able to verify in the BuddyPress directory there is a activate.php and register.php file but they are not in the dropdown selection when associating the WordPress page with the BuddyPress component directory.
If I could get a simple yes/no answer to whether or not the two pages are indeed created by BuddyPress during install I would appreciate it!
I can’t figure out what is going on.
That snippet is 6 years old. BuddyPress is slightly different today.
Some explanation here:
bp_is_current_component
bp_current_action
May be you can also read here:
Template Overload from a Plugin
– it’s the (or one of the) “default” wp themes ( https://wordpress.org/themes/twentyfourteen/ )
about the only way you will get any kind of support with bp or / and rtmedia..
it’s not the easiest thing to mod – but at least it works, and bp has some stylesheets included that massage it into something better than the average theme for some bp pages..
I finally got deep into it to style some changes at the various media queries / screen sizes..
btw – did you try changing your premium themes style.css to those changes to see if they work?
if you search the bp forums for other premium themes you will see that even ones selling as “the best or the most popular buddypress theme” – seem to have issues and lack good support.. search the forums for “kleo” for example – lol
I am sticking with twenty fourteen ’till things mature a bit (recent changes in wp and bp have made things complex in some ways) –
Hi!
I’ve just referred ‘John James Jacoby’ to create a custom page dynamically without going into the admin panel.
I can get the current component name in default buddypress pages using the below code:
global $bp; var_dump($bp->current_action);
But the problem I face here is that when I try create a new page as mentioned in the ‘John James Jacoby’, I get 404 error. I can’t figure out what is going on. Any help would be appreciated.
Thanks in Advance..
Within the menu page under Appearance there is an option under Buddypress called Groups. you should use this as your menu item instead of the current Groups menu item, this will only display the groups the user is a member of.