Editing User Profile Content in BuddyBoss and/or BuddyPress - php

I'm trying to remove 'Notifications', 'Groups', 'Messages', & 'Settngs' from user profiles.
How do I go about removing them?
Check out below:
<?php do_action( 'bp_before_profile_edit_content' );
if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) ) :
while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
<form action="<?php bp_the_profile_group_edit_form_action(); ?>" method="post" id="profile-edit-form" class="standard-form <?php bp_the_profile_group_slug(); ?>">
<?php do_action( 'bp_before_profile_field_content' ); ?>
<h4><?php printf( __( "Editing '%s' Profile Group", "buddypress" ), bp_get_the_profile_group_name() ); ?></h4>
<ul class="button-nav">
<?php bp_profile_group_tabs(); ?>
</ul>
<div class="clear"></div>
<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
<div<?php bp_field_css_class( 'editfield' ); ?>>
<?php
$field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() );
$field_type->edit_field_html();
do_action( 'bp_custom_profile_edit_fields_pre_visibility' );
?>
<?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?>
<p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
<?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> <?php _e( 'Change', 'buddypress' ); ?>
</p>
<div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>">
<fieldset>
<legend><?php _e( 'Who can see this field?', 'buddypress' ) ?></legend>
<?php bp_profile_visibility_radio_buttons() ?>
</fieldset>
<a class="field-visibility-settings-close" href="#"><?php _e( 'Close', 'buddypress' ) ?></a>
</div>
<?php else : ?>
<div class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
<?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?>
</div>
<?php endif ?>
<p class="description"><?php bp_the_profile_field_description(); ?></p>
</div>
<?php do_action( 'bp_custom_profile_edit_fields' ); ?>
<?php endwhile; ?>
<?php do_action( 'bp_after_profile_field_content' ); ?>
<div class="submit">
<input type="submit" name="profile-group-edit-submit" id="profile-group-edit-submit" value="<?php esc_attr_e( 'Save Changes', 'buddypress' ); ?> " />
</div>
<input type="hidden" name="field_ids" id="field_ids" value="<?php bp_the_profile_group_field_ids(); ?>" />
<?php wp_nonce_field( 'bp_xprofile_edit' ); ?>
</form>
<?php endwhile; endif; ?>
<?php do_action( 'bp_after_profile_edit_content' ); ?>

Try:
function evin_remove_nav() {
bp_core_remove_nav_item( 'messages' );
//etc
}
add_action( 'bp_ready', 'evin_remove_nav', 10 );

Related

Buddyboss Group Filter

In the Buddyboss Group Loop are all groups displayed.
I want to add a filter that only groups with a specific categrorie are displayed in the first grid.
I added the comment to the first grid and found out that i can display another grid when
i duplicate the code a second time, but i have the filter problem.
Then i want to add another grid with also a filter to another group categorie.
How can i achieve this?
I dont get it how to add a filter.
<?php
/**
* BuddyBoss - Groups Loop
*
* #since BuddyPress 3.0.0
* #version 3.1.0
*/
bp_nouveau_before_loop(); ?>
<?php if ( bp_get_current_group_directory_type() ) : ?>
<div class="bp-feedback info">
<span class="bp-icon" aria-hidden="true"></span>
<p class="current-group-type"><?php bp_current_group_directory_type_message(); ?></p>
</div>
<?php endif; ?>
<?php $cover_class = bp_disable_group_cover_image_uploads() ? 'bb-cover-disabled' : 'bb-cover-enabled'; ?>
<?php if ( bp_has_groups( bp_ajax_querystring( 'groups' ) ) ) : ?>
<?php bp_nouveau_pagination( 'top' ); ?>
//FIRST GRID ONLY FOR "KOMMISIONEN"
<ul id="groups-list-kommissionen" class="<?php bp_nouveau_loop_classes(); ?> <?php echo $cover_class; ?>">
<?php
while ( bp_groups() ) :
bp_the_group();
?>
<li <?php bp_group_class( array( 'item-entry' ) ); ?> data-bp-item-id="<?php bp_group_id(); ?>" data-bp-item-component="groups">
<div class="list-wrap">
<?php if( !bp_disable_group_cover_image_uploads() ) { ?>
<?php
$group_cover_image_url = bp_attachments_get_attachment( 'url', array(
'object_dir' => 'groups',
'item_id' => bp_get_group_id(),
) );
$default_group_cover = buddyboss_theme_get_option( 'buddyboss_group_cover_default', 'url' );
$group_cover_image_url = $group_cover_image_url ?: $default_group_cover;
?>
<div class="bs-group-cover only-grid-view"><img src="<?php echo $group_cover_image_url; ?>"></div>
<?php } ?>
<?php if ( ! bp_disable_group_avatar_uploads() ) : ?>
<div class="item-avatar">
<?php bp_group_avatar( bp_nouveau_avatar_args() ); ?>
<div class="groups-loop-buttons only-grid-view">
<?php bp_nouveau_groups_loop_buttons(); ?>
</div>
</div>
<?php endif; ?>
<div class="item">
<div class="item-block">
<h2 class="list-title groups-title"><?php bp_group_link(); ?></h2>
<?php if ( bp_nouveau_group_has_meta() ) : ?>
<p class="item-meta group-details only-list-view"><?php bp_nouveau_group_meta(); ?></p>
<p class="item-meta group-details only-grid-view"><?php
$meta = bp_nouveau_get_group_meta();
echo $meta['status']; ?>
</p>
<?php endif; ?>
<p class="last-activity item-meta">
<?php
printf(
/* translators: %s = last activity timestamp (e.g. "active 1 hour ago") */
__( 'active %s', 'buddyboss-theme' ),
bp_get_group_last_active()
);
?>
</p>
</div>
<div class="item-desc group-item-desc only-list-view"><?php bp_group_description_excerpt( false , 150 ) ?></div>
<?php bp_nouveau_groups_loop_item(); ?>
<div class="groups-loop-buttons footer-button-wrap"><?php bp_nouveau_groups_loop_buttons(); ?></div>
<div class="group-members-wrap only-grid-view">
<?php echo buddyboss_theme()->buddypress_helper()->group_members( bp_get_group_id(), array( 'member', 'mod', 'admin' ) ); ?>
</div>
</div>
</div>
</li>
<?php endwhile; ?>
<?php bp_nouveau_pagination( 'bottom' ); ?>
<?php else : ?>
<?php bp_nouveau_user_feedback( 'groups-loop-none' ); ?>
<?php endif; ?>
<?php
bp_nouveau_after_loop();
Okay i found the answer by trying all possible ways.
Here is the solution code.
<?php
/**
* BuddyBoss - Groups Loop
*
* #since BuddyPress 3.0.0
* #version 3.1.0
*/
bp_nouveau_before_loop(); ?>
<?php if ( bp_get_current_group_directory_type() ) : ?>
<div class="bp-feedback info">
<span class="bp-icon" aria-hidden="true"></span>
<p class="current-group-type"><?php bp_current_group_directory_type_message(); ?></p>
</div>
<?php endif; ?>
<?php $cover_class = bp_disable_group_cover_image_uploads() ? 'bb-cover-disabled' : 'bb-cover-enabled'; ?>
<?php if ( bp_has_groups( 'group_type=kommission' ) ) : ?>
<?php bp_nouveau_pagination( 'top' ); ?>
<ul id="groups-list-kommissionen" class="<?php bp_nouveau_loop_classes(); ?> <?php echo $cover_class; ?>">
<?php
while ( bp_groups() ) :
bp_the_group();
?>
<li <?php bp_group_class( array( 'item-entry' ) ); ?> data-bp-item-id="<?php bp_group_id(); ?>" data-bp-item-component="groups">
<div class="list-wrap">
<?php if( !bp_disable_group_cover_image_uploads() ) { ?>
<?php
$group_cover_image_url = bp_attachments_get_attachment( 'url', array(
'object_dir' => 'groups',
'item_id' => bp_get_group_id(),
) );
$default_group_cover = buddyboss_theme_get_option( 'buddyboss_group_cover_default', 'url' );
$group_cover_image_url = $group_cover_image_url ?: $default_group_cover;
?>
<div class="bs-group-cover only-grid-view"><img src="<?php echo $group_cover_image_url; ?>"></div>
<?php } ?>
<?php if ( ! bp_disable_group_avatar_uploads() ) : ?>
<div class="item-avatar">
<?php bp_group_avatar( bp_nouveau_avatar_args() ); ?>
<div class="groups-loop-buttons only-grid-view">
<?php bp_nouveau_groups_loop_buttons(); ?>
</div>
</div>
<?php endif; ?>
<div class="item">
<div class="item-block">
<h2 class="list-title groups-title"><?php bp_group_link(); ?></h2>
<?php if ( bp_nouveau_group_has_meta() ) : ?>
<p class="item-meta group-details only-list-view"><?php bp_nouveau_group_meta(); ?></p>
<p class="item-meta group-details only-grid-view"><?php
$meta = bp_nouveau_get_group_meta();
echo $meta['status']; ?>
</p>
<?php endif; ?>
<p class="last-activity item-meta">
<?php
printf(
/* translators: %s = last activity timestamp (e.g. "active 1 hour ago") */
__( 'active %s', 'buddyboss-theme' ),
bp_get_group_last_active()
);
?>
</p>
</div>
<div class="item-desc group-item-desc only-list-view"><?php bp_group_description_excerpt( false , 150 ) ?></div>
<?php bp_nouveau_groups_loop_item(); ?>
<div class="groups-loop-buttons footer-button-wrap"><?php bp_nouveau_groups_loop_buttons(); ?></div>
<div class="group-members-wrap only-grid-view">
<?php echo buddyboss_theme()->buddypress_helper()->group_members( bp_get_group_id(), array( 'member', 'mod', 'admin' ) ); ?>
</div>
</div>
</div>
</li>
<?php endwhile; ?>
</ul>
<?php bp_nouveau_pagination( 'bottom' ); ?>
<?php else : ?>
<?php bp_nouveau_user_feedback( 'groups-loop-none' ); ?>
<?php endif; ?>
<?php if ( bp_has_groups( 'group_type=task-force' ) ) : ?>
<?php bp_nouveau_pagination( 'top' ); ?>
<ul id="groups-list-taskForces" class="<?php bp_nouveau_loop_classes(); ?> <?php echo $cover_class; ?>">
<?php
while ( bp_groups() ) :
bp_the_group();
?>
<li <?php bp_group_class( array( 'item-entry' ) ); ?> data-bp-item-id="<?php bp_group_id(); ?>" data-bp-item-component="groups">
<div class="list-wrap">
<?php if( !bp_disable_group_cover_image_uploads() ) { ?>
<?php
$group_cover_image_url = bp_attachments_get_attachment( 'url', array(
'object_dir' => 'groups',
'item_id' => bp_get_group_id(),
) );
$default_group_cover = buddyboss_theme_get_option( 'buddyboss_group_cover_default', 'url' );
$group_cover_image_url = $group_cover_image_url ?: $default_group_cover;
?>
<div class="bs-group-cover only-grid-view"><img src="<?php echo $group_cover_image_url; ?>"></div>
<?php } ?>
<?php if ( ! bp_disable_group_avatar_uploads() ) : ?>
<div class="item-avatar">
<?php bp_group_avatar( bp_nouveau_avatar_args() ); ?>
<div class="groups-loop-buttons only-grid-view">
<?php bp_nouveau_groups_loop_buttons(); ?>
</div>
</div>
<?php endif; ?>
<div class="item">
<div class="item-block">
<h2 class="list-title groups-title"><?php bp_group_link(); ?></h2>
<?php if ( bp_nouveau_group_has_meta() ) : ?>
<p class="item-meta group-details only-list-view"><?php bp_nouveau_group_meta(); ?></p>
<p class="item-meta group-details only-grid-view"><?php
$meta = bp_nouveau_get_group_meta();
echo $meta['status']; ?>
</p>
<?php endif; ?>
<p class="last-activity item-meta">
<?php
printf(
/* translators: %s = last activity timestamp (e.g. "active 1 hour ago") */
__( 'active %s', 'buddyboss-theme' ),
bp_get_group_last_active()
);
?>
</p>
</div>
<div class="item-desc group-item-desc only-list-view"><?php bp_group_description_excerpt( false , 150 ) ?></div>
<?php bp_nouveau_groups_loop_item(); ?>
<div class="groups-loop-buttons footer-button-wrap"><?php bp_nouveau_groups_loop_buttons(); ?></div>
<div class="group-members-wrap only-grid-view">
<?php echo buddyboss_theme()->buddypress_helper()->group_members( bp_get_group_id(), array( 'member', 'mod', 'admin' ) ); ?>
</div>
</div>
</div>
</li>
<?php endwhile; ?>
</ul>
<?php bp_nouveau_pagination( 'bottom' ); ?>
<?php else : ?>
<?php bp_nouveau_user_feedback( 'groups-loop-none' ); ?>
<?php endif; ?>
<?php
bp_nouveau_after_loop();

Restrict Content Pro Expand Invoice Details

I am looking for advice on how to expand invoice details using the Restrict Content Pro Wordpress plugin. I'm unsure on how to go about showing the breakdown of a subscription level on an invoice. I've hit a learning curve with figuring this out with their code. I've attached the invoice.php, how do I tackle this?
My connumdrum: I have a subscription that is 295$. The breakdown is: Membership fee - 195$, Insurance Policy - 100$. I just need to show the breakdown, it's probably super simple.
I did try just putting a ul tag and just list the breakdown with li tags. But, that would cause confusion because it would show up all invoices with different levels.
Invoice Code:
<body>
<div id="main">
<header id="header">
<!-- Logo -->
<div class="logo">
<?php if ( ! empty( $rcp_options['invoice_logo'] ) ) : ?>
<img src="<?php echo esc_attr( $rcp_options['invoice_logo'] ); ?>" />
<?php endif; ?>
</div>
<!-- Invoice Details -->
<div class="alignright">
<h1><?php printf( __( 'Invoice %s', 'rcp' ), $rcp_payment->id ); ?> </h1>
</div>
<?php if( ! empty( $rcp_options['invoice_header'] ) ) : ?>
<p><?php echo $rcp_options['invoice_header']; ?></p>
<?php endif; ?>
</header>
<section id="contacts">
<div class="alignleft">
<header><?php printf( __( 'Invoice %s', 'rcp' ), $rcp_payment->id ); ?></header>
<article>
<?php if ( ! empty( $rcp_options['invoice_company'] ) ) : ?>
<p><strong><?php echo $rcp_options['invoice_company']; ?></strong></p>
<?php endif; ?>
<?php if ( ! empty( $rcp_options['invoice_name'] ) ) : ?>
<p><strong><?php echo $rcp_options['invoice_name']; ?></strong></p>
<?php endif; ?>
<?php if ( ! empty( $rcp_options['invoice_address'] ) ) : ?>
<p><strong><?php echo $rcp_options['invoice_address']; ?></strong></p>
<?php endif; ?>
<?php if ( ! empty( $rcp_options['invoice_address_2'] ) ) : ?>
<p><strong><?php echo $rcp_options['invoice_address_2']; ?></strong></p>
<?php endif; ?>
<?php if ( ! empty( $rcp_options['invoice_city_state_zip'] ) ) : ?>
<p><strong><?php echo $rcp_options['invoice_city_state_zip']; ?></strong></p>
<?php endif; ?>
<?php if ( ! empty( $rcp_options['invoice_email'] ) ) : ?>
<p><strong><?php echo $rcp_options['invoice_email']; ?></strong></p>
<?php endif; ?>
</article>
</div>
<div class="alignright">
<header><?php _e( 'Bill To:', 'rcp' ); ?></header>
<article>
<p><strong><?php echo $rcp_member->first_name . ' ' . $rcp_member->last_name; ?></strong></p>
<p><strong><?php echo $rcp_member->user_email; ?></strong></p>
<?php
/**
* Insert content after the member's name and email.
*
* #param object $rcp_payment Payment object from the database.
* #param RCP_Member $rcp_member Member object.
*/
do_action( 'rcp_invoice_bill_to', $rcp_payment, $rcp_member );
?>
</article>
</div>
</section>
<!-- Items -->
<section id="items">
<header><?php _e( 'Invoice Items:', 'rcp' ); ?></header>
<table>
<tbody>
<tr>
<td class="name"><?php echo $rcp_payment->subscription; ?></td>
<td class="price"><?php echo rcp_currency_filter( $rcp_payment->amount ); ?></td>
</tr>
<?php do_action( 'rcp_invoice_items', $rcp_payment ); ?>
</tbody>
<tfoot>
<?php do_action( 'rcp_invoice_items_before_total_price', $rcp_payment ); ?>
<!-- Total -->
<tr>
<td class="name"><?php _e( 'Total Price:', 'rcp' ); ?></td>
<td class="price"><?php echo rcp_currency_filter( $rcp_payment->amount ); ?></td>
</tr>
<!-- Paid -->
<tr>
<td class="name"><?php _e( 'Payment Status:', 'rcp' ); ?></td>
<td class="price"><?php echo rcp_get_payment_status_label( $rcp_payment ); ?></td>
</tr>
</tfoot>
</table>
</section>
<!-- Additional Info -->
<section id="additional-info">
<div class="alignleft">
<header><?php _e( 'Additional Info:', 'rcp' ); ?></header>
<article>
<p><?php echo __( 'Payment Date:', 'rcp' ) . ' ' . date_i18n( get_option( 'date_format' ), strtotime( $rcp_payment->date, current_time( 'timestamp' ) ) ); ?></p>
</article>
<?php if( ! empty( $rcp_options['invoice_notes'] ) ) : ?>
<article>
<?php echo wpautop( wp_kses_post( $rcp_options['invoice_notes'] ) ); ?>
</article>
<?php endif; ?>
<?php do_action( 'rcp_invoice_additional_info', $rcp_payment ); ?>
</div>
</section>
<?php do_action( 'rcp_invoice_after_additional_info', $rcp_payment ); ?>
<footer id="footer">
<?php if( ! empty( $rcp_options['invoice_footer'] ) ) : ?>
<p><?php echo $rcp_options['invoice_footer']; ?></p>
<?php endif; ?>
<p class="print alignright"><?php _e( 'Print', 'rcp' ); ?></p>
</footer>
</div>

BuddyPress registration form shortcode

I'm trying to get the registration form for BuddyPress.
I searching for a shortcode or just php code.
I've try to copy the field in template's of buddypress plugin. But it's dosen't work.
Here is the code I place in a custom post type.
<div id="buddypress">
<?php do_action( 'bp_before_register_page' ); ?>
<div class="page" id="register-page">
<form action="" name="signup_form" id="signup_form" class="standard-form" method="post" enctype="multipart/form-data">
<?php if ( 'registration-disabled' == bp_get_current_signup_step() ) : ?>
<?php do_action( 'template_notices' ); ?>
<?php do_action( 'bp_before_registration_disabled' ); ?>
<p><?php _e( 'User registration is currently not allowed.', 'buddypress' ); ?></p>
<?php do_action( 'bp_after_registration_disabled' ); ?>
<?php endif; // registration-disabled signup setp ?>
<?php if ( 'request-details' == bp_get_current_signup_step() ) : ?>
<?php do_action( 'template_notices' ); ?>
<p><?php _e( 'Registering for this site is easy. Just fill in the fields below, and we\'ll get a new account set up for you in no time.', 'buddypress' ); ?></p>
<?php do_action( 'bp_before_account_details_fields' ); ?>
<div class="register-section" id="basic-details-section">
<?php /***** Basic Account Details ******/ ?>
<h4><?php _e( 'Account Details', 'buddypress' ); ?></h4>
<label for="signup_username"><?php _e( 'Username', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
<?php do_action( 'bp_signup_username_errors' ); ?>
<input type="text" name="signup_username" id="signup_username" value="<?php bp_signup_username_value(); ?>" />
<label for="signup_email"><?php _e( 'Email Address', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
<?php do_action( 'bp_signup_email_errors' ); ?>
<input type="text" name="signup_email" id="signup_email" value="<?php bp_signup_email_value(); ?>" />
<label for="signup_password"><?php _e( 'Choose a Password', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
<?php do_action( 'bp_signup_password_errors' ); ?>
<input type="password" name="signup_password" id="signup_password" value="" class="password-entry" />
<div id="pass-strength-result"></div>
<label for="signup_password_confirm"><?php _e( 'Confirm Password', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
<?php do_action( 'bp_signup_password_confirm_errors' ); ?>
<input type="password" name="signup_password_confirm" id="signup_password_confirm" value="" class="password-entry-confirm" />
<?php do_action( 'bp_account_details_fields' ); ?>
</div><!-- #basic-details-section -->
<?php do_action( 'bp_after_account_details_fields' ); ?>
<?php /***** Extra Profile Details ******/ ?>
<?php if ( bp_is_active( 'xprofile' ) ) : ?>
<?php do_action( 'bp_before_signup_profile_fields' ); ?>
<div class="register-section" id="profile-details-section">
<h4><?php _e( 'Profile Details', 'buddypress' ); ?></h4>
<?php /* Use the profile field loop to render input fields for the 'base' profile field group */ ?>
<?php if ( bp_is_active( 'xprofile' ) ) : if ( bp_has_profile( array( 'profile_group_id' => 1, 'fetch_field_data' => false ) ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
<div<?php bp_field_css_class( 'editfield' ); ?>>
<?php
$field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() );
$field_type->edit_field_html();
do_action( 'bp_custom_profile_edit_fields_pre_visibility' );
if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?>
<p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
<?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> <?php _ex( 'Change', 'Change profile field visibility level', 'buddypress' ); ?>
</p>
<div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>">
<fieldset>
<legend><?php _e( 'Who can see this field?', 'buddypress' ) ?></legend>
<?php bp_profile_visibility_radio_buttons() ?>
</fieldset>
<a class="field-visibility-settings-close" href="#"><?php _e( 'Close', 'buddypress' ) ?></a>
</div>
<?php else : ?>
<p class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
<?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?>
</p>
<?php endif ?>
<?php do_action( 'bp_custom_profile_edit_fields' ); ?>
<p class="description"><?php bp_the_profile_field_description(); ?></p>
</div>
<?php endwhile; ?>
<input type="hidden" name="signup_profile_field_ids" id="signup_profile_field_ids" value="<?php bp_the_profile_field_ids(); ?>" />
<?php endwhile; endif; endif; ?>
<?php do_action( 'bp_signup_profile_fields' ); ?>
</div><!-- #profile-details-section -->
<?php do_action( 'bp_after_signup_profile_fields' ); ?>
<?php endif; ?>
<?php if ( bp_get_blog_signup_allowed() ) : ?>
<?php do_action( 'bp_before_blog_details_fields' ); ?>
<?php /***** Blog Creation Details ******/ ?>
<div class="register-section" id="blog-details-section">
<h4><?php _e( 'Blog Details', 'buddypress' ); ?></h4>
<p><input type="checkbox" name="signup_with_blog" id="signup_with_blog" value="1"<?php if ( (int) bp_get_signup_with_blog_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'Yes, I\'d like to create a new site', 'buddypress' ); ?></p>
<div id="blog-details"<?php if ( (int) bp_get_signup_with_blog_value() ) : ?>class="show"<?php endif; ?>>
<label for="signup_blog_url"><?php _e( 'Blog URL', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
<?php do_action( 'bp_signup_blog_url_errors' ); ?>
<?php if ( is_subdomain_install() ) : ?>
http:// <input type="text" name="signup_blog_url" id="signup_blog_url" value="<?php bp_signup_blog_url_value(); ?>" /> .<?php bp_signup_subdomain_base(); ?>
<?php else : ?>
<?php echo home_url( '/' ); ?> <input type="text" name="signup_blog_url" id="signup_blog_url" value="<?php bp_signup_blog_url_value(); ?>" />
<?php endif; ?>
<label for="signup_blog_title"><?php _e( 'Site Title', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
<?php do_action( 'bp_signup_blog_title_errors' ); ?>
<input type="text" name="signup_blog_title" id="signup_blog_title" value="<?php bp_signup_blog_title_value(); ?>" />
<span class="label"><?php _e( 'I would like my site to appear in search engines, and in public listings around this network.', 'buddypress' ); ?></span>
<?php do_action( 'bp_signup_blog_privacy_errors' ); ?>
<label><input type="radio" name="signup_blog_privacy" id="signup_blog_privacy_public" value="public"<?php if ( 'public' == bp_get_signup_blog_privacy_value() || !bp_get_signup_blog_privacy_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'Yes', 'buddypress' ); ?></label>
<label><input type="radio" name="signup_blog_privacy" id="signup_blog_privacy_private" value="private"<?php if ( 'private' == bp_get_signup_blog_privacy_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'No', 'buddypress' ); ?></label>
<?php do_action( 'bp_blog_details_fields' ); ?>
</div>
</div><!-- #blog-details-section -->
<?php do_action( 'bp_after_blog_details_fields' ); ?>
<?php endif; ?>
<?php do_action( 'bp_before_registration_submit_buttons' ); ?>
<div class="submit">
<input type="submit" name="signup_submit" id="signup_submit" value="<?php esc_attr_e( 'Complete Sign Up', 'buddypress' ); ?>" />
</div>
<?php do_action( 'bp_after_registration_submit_buttons' ); ?>
<?php wp_nonce_field( 'bp_new_signup' ); ?>
<?php endif; // request-details signup step ?>
<?php if ( 'completed-confirmation' == bp_get_current_signup_step() ) : ?>
<?php do_action( 'template_notices' ); ?>
<?php do_action( 'bp_before_registration_confirmed' ); ?>
<?php if ( bp_registration_needs_activation() ) : ?>
<p><?php _e( 'You have successfully created your account! To begin using this site you will need to activate your account via the email we have just sent to your address.', 'buddypress' ); ?></p>
<?php else : ?>
<p><?php _e( 'You have successfully created your account! Please log in using the username and password you have just created.', 'buddypress' ); ?></p>
<?php endif; ?>
<?php do_action( 'bp_after_registration_confirmed' ); ?>
<?php endif; // completed-confirmation signup step ?>
<?php do_action( 'bp_custom_signup_steps' ); ?>
</form>
</div>
<?php do_action( 'bp_after_register_page' ); ?>
</div><!-- #buddypress -->
Are you not happy with the default form that shows up? When buddypress is installed it creates a few pages on your site. If you navigate to Settings->BuddyPress ->pages, you will see that the register page is pointing to... well Register :) There should be a "Register" page present in your All Pages. This is installed by buddypress
By Default, buddypress installs a Register page at : www.yoursite.com/Register
Open it while you are not log in and you can see the Registration Form.
Go to buddypress plugin template folder:
wp-content\plugins\buddypress\bp-templates\bp-legacy\buddypress
Copy the buddypress folder and paste it into your theme's root.
Now go to:
wp-content\YOURTHEME\buddypress\bp-templates\bp-legacy\buddypress\members folder and you will find a register.php file. You can work with it.

How to insert "Author" code in Wordpress Required theme?

Been trying to insert "By Author" by <?php the_author() ?> code on a Wordpress theme(Required by 8Bit). Request to help. Need to insert after the post/page title and before date.
The code is as follows:
<header>
<?php if ( 0 < strlen( get_the_title() ) ) { ?>
<h1 class="entry-title">
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
</h1><!-- /.entry-title -->
<?php } // end if ?>
<div class="post-meta">
<span class="post-date">
<?php if ( 0 < strlen( get_the_title() ) ) { ?>
<?php the_time( get_option( 'date_format' ) ); ?>
<?php } else { ?>
<a href="<?php the_permalink(); ?>">
<?php the_time( get_option( 'date_format' ));?>
</a>
<?php } // end if/else ?>
</span><!-- /.post-date -->
<?php _e( ' | ', 'required' ); ?>
<span class="comment-link">
<?php
comments_popup_link( 'Comment', '1 comment', '% comments',
'comments-link', '');
?>
</span><!-- /.comment-link -->
<?php edit_post_link( '- edit ', '<span>', '</span>'); ?>
</div><!-- /.post-meta -->
</header>
Thanks :)
This is the loop code:
<?php
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
get_template_part( 'content', get_post_format() );
} // end while
Here's an example, between the title and date:
<header>
<?php if ( 0 < strlen( get_the_title() ) ) { ?>
<h1 class="entry-title">
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
</h1><!-- /.entry-title -->
<?php } // end if ?>
<div class="post-meta">
<?php the_author(); ?>
<span class="post-date">
<?php if ( 0 < strlen( get_the_title() ) ) { ?>
<?php the_time( get_option( 'date_format' ) ); ?>
<?php } else { ?>
<a href="<?php the_permalink(); ?>">
<?php the_time( get_option( 'date_format' ));?>
</a>
<?php } // end if/else ?>
</span><!-- /.post-date -->
<?php _e( ' | ', 'required' ); ?>
<span class="comment-link">
<?php
comments_popup_link( 'Comment', '1 comment', '% comments',
'comments-link', '');
?>
</span><!-- /.comment-link -->
<?php edit_post_link( '- edit ', '<span>', '</span>'); ?>
</div><!-- /.post-meta -->
</header>

Wordpress: Comments: Submitting a comment opens a related post

I have a problem with my comments form.
Submitting a comment leads to open a related post.
Here's my comments.php:
<?php
if ( post_password_required() ) :
echo '<h3 class="comments-header">' . __('Password Protected', 'buddypress') . '</h3>';
echo '<p class="alert password-protected">' . __('Enter the password to view comments.', 'buddypress') . '</p>';
return;
endif;
if ( is_page() && !have_comments() && !comments_open() && !pings_open() )
return;
?>
<?php if ( have_comments() ) : ?>
<div id="comments">
<?php
// Only include comments
$numTrackBacks = 0; $numComments = 0;
foreach ( (array)$comments as $comment )
if ( 'comment' != get_comment_type() )
$numTrackBacks++;
else
$numComments++;
?>
<h3 id="comments">
<?php
printf( _n( '1 Kommentar', '%1$s Kommentare', $numComments, 'buddypress' ),
number_format_i18n( $numComments ), '<em>' . get_the_title() . '</em>' );
?>
</h3>
<?php do_action( 'bp_before_blog_comment_list' ) ?>
<ol class="commentlist">
<?php wp_list_comments() ; ?>
</ol><!-- .comment-list -->
<?php do_action( 'bp_after_blog_comment_list' ) ?>
<?php if ( get_option( 'page_comments' ) ) : ?>
<div class="comment-navigation paged-navigation">
<?php paginate_comments_links(); ?>
</div>
<?php endif; ?>
</div><!-- #comments -->
<?php else : ?>
<?php if ( pings_open() && !comments_open() && is_single() ) : ?>
<p class="comments-closed pings-open">
<?php printf( __('Comments are closed, but trackbacks and pingbacks are open.', 'buddypress'), trackback_url( '0' ) ); ?>
</p>
<?php elseif ( !comments_open() && is_single() ) : ?>
<p class="comments-closed">
<?php _e('Keine Kommentare erlaubt.', 'buddypress'); ?>
</p>
<?php endif; ?>
<?php endif; ?>
<?php if ( comments_open() ) : ?>
<div id="respond">
<div class="comment-avatar-box">
<div class="avb">
<?php if ( bp_loggedin_user_id() ) : ?>
<a href="<?php echo bp_loggedin_user_domain() ?>">
<?php echo get_avatar( bp_loggedin_user_id(), 50 ); ?>
</a>
<?php else : ?>
<?php echo get_avatar( 0, 50 ); ?>
<?php endif; ?>
</div>
</div>
<div class="comment-content">
<h3 id="reply" class="comments-header">
<?php comment_form_title( __( 'Leave a Reply', 'buddypress' ), __( 'Leave a Reply to %s', 'buddypress' ), true ); ?>
</h3>
<p id="cancel-comment-reply">
<?php cancel_comment_reply_link( __( 'Click here to cancel reply.', 'buddypress' ) ); ?>
</p>
<?php if ( get_option( 'comment_registration' ) && !$user_ID ) : ?>
<p class="alert">
<?php printf( __('You must be logged in to post a comment.', 'buddypress'), wp_login_url( get_permalink() ) ); ?>
</p>
<?php else : ?>
<?php do_action( 'bp_before_blog_comment_form' ) ?>
<form action="<?php echo site_url( 'wp-comments-post.php' ) ?>" method="post" id="commentform" class="standard-form">
<?php if ( $user_ID ) : ?>
<p class="log-in-out">
<?php printf( __('Logged in as %2$s.', 'buddypress'), bp_loggedin_user_domain(), $user_identity ); ?> <?php _e('Log out →', 'buddypress'); ?>
</p>
<?php else : ?>
<?php $req = get_option( 'require_name_email' ); ?>
<p class="form-author">
<label for="author"><?php _e('Name', 'buddypress'); ?> <?php if ( $req ) : ?><span class="required"><?php _e('*', 'buddypress'); ?></span><?php endif; ?></label>
<input type="text" class="text-input" name="author" id="author" value="<?php echo $comment_author; ?>" size="40" tabindex="1" />
</p>
<p class="form-email">
<label for="email"><?php _e('Email', 'buddypress'); ?> <?php if ( $req ) : ?><span class="required"><?php _e('*', 'buddypress'); ?></span><?php endif; ?></label>
<input type="text" class="text-input" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="40" tabindex="2" />
</p>
<p class="form-url">
<label for="url"><?php _e('Website', 'buddypress'); ?></label>
<input type="text" class="text-input" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="40" tabindex="3" />
</p>
<?php endif; ?>
<p class="form-textarea">
<label for="comment"><?php _e('Comment', 'buddypress'); ?></label>
<textarea name="comment" id="comment" cols="60" rows="10" tabindex="4"></textarea>
</p>
<?php do_action( 'bp_blog_comment_form' ) ?>
<p class="form-submit">
<input class="submit-comment button" name="submit" type="submit" id="submit" tabindex="5" value="<?php _e('Submit', 'buddypress'); ?>" />
<?php comment_id_fields(); ?>
</p>
<div class="comment-action">
<?php do_action( 'comment_form', $post->ID ); ?>
</div>
</form>
<?php do_action( 'bp_after_blog_comment_form' ) ?>
<?php endif; ?>
</div><!-- .comment-content -->
</div><!-- #respond -->
<?php endif; ?>
<?php if ( $numTrackBacks ) : ?>
<div id="trackbacks">
<span class="title"><?php the_title() ?></span>
<?php if ( 1 == $numTrackBacks ) : ?>
<h3><?php printf( __( '%d Trackback', 'buddypress' ), $numTrackBacks ) ?></h3>
<?php else : ?>
<h3><?php printf( __( '%d Trackbacks', 'buddypress' ), $numTrackBacks ) ?></h3>
<?php endif; ?>
<ul id="trackbacklist">
<?php foreach ( (array)$comments as $comment ) : ?>
<?php if ( get_comment_type() != 'comment' ) : ?>
<li><h5><?php comment_author_link() ?></h5><em>on <?php comment_date() ?></em></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
An answer would be appreciated
Update:
My single.php:
<?php get_header(); ?>
<!-- LAESST DEN HEADER ERSCHEINEN -->
<div id="main">
<!-- DAS IST DER LOOP! HIER WIRD DER BEFEHL GEGEBEN, DEN INHALT ANZUZEIGEN (ARTIKEL ETC) -->
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h2><?php the_title(); ?></h2> <!-- DIESER BEFEHL ZEIGT UND VERLINKT DIE ARTIKEL UEBERSCHRIFT -->
<div class="entry">
<?php the_content(); ?>
</div>
<?php endwhile; ?>
<div class="author-box">
<p><?php echo get_avatar( get_the_author_meta( 'user_email' ), '50' ); ?></p>
<p><?php printf( __( 'Geschrieben von %s', 'buddypress' ), bp_core_get_userlink( $post->post_author ) ) ?> am <?php the_time('j. F Y'); ?> um <?php the_time(); ?></p>
<p> Kategorie(n): <?php the_category(', '); ?> </p>
</div>
<div id="related-posts"
<?php
$tags = wp_get_post_tags($post->ID);
if ($tags) {
$tag_ids = array();
foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
$args=array(
'tag__in' => $tag_ids,
'post__not_in' => array($post->ID),
'showposts'=>3, // Number of related posts that will be shown.
'caller_get_posts'=>1
);
$my_query = new wp_query($args);
if( $my_query->have_posts() ) {
echo '<h3>Das könnte dich auch interessieren</h3><ul>';
while ($my_query->have_posts()) {
$my_query->the_post();
?>
<li><?php the_title(); ?></li>
<?php
}
echo '</ul>';
}
}
?>
</div>
<!--"NEXT POST" BZW "PREVIOUS POST" NAVIGATION -->
<p align="center"><?php next_posts_link('« Ältere Einträge') ?> <?php previous_posts_link('Neuere Einträge »') ?></p>
<?php endif; ?>
<?php comments_template(); ?> <!-- LAESST DAS KOMMENTARFELD ERSCHEINEN -->
</div><!-- main -->
<div id="sidebar">
<?php get_sidebar(); ?>
<!-- LAESST DIE SIDEBAR ERSCHEINEN -->
</div><!-- sidebar -->
<?php get_footer(); ?>
<!-- DIESER BEFEHL LAESST DEN FOOTER ERSCHEINEN -->
But why is it displayed incorrectly?
The only point in your code that could be responsible for your problem, as far as I can see, is at:
<div class="comment-action">
<?php do_action( 'comment_form', $post->ID ); ?>
</div>
$post->ID should hold the id of the current post or be null. If there is a problem with $post, it will be on the page that calls this comments template, single.php probably. You could try changing your current single.php file for the twentyten one and see if that solves the problem. Or post here that single.php file contents so we can check it.
EDIT:
On the single.php file, you have a new query being executed to get the related posts:
$args=array(
'tag__in' => $tag_ids,
'post__not_in' => array($post->ID),
'showposts'=>3, // Number of related posts that will be shown.
'caller_get_posts'=>1
);
$my_query = new wp_query($args);
if( $my_query->have_posts() ) {
This code is populating the $post variable with each of the related posts found, so once that code is done you will have the $post var holding the last post of the related posts retrieved with that query.
Easiest solution: cut the code for the related posts functionality (everything inside de "related-posts" div, including the opening and closing div tags) and paste it just before the </div><!-- main --> so it doesn't affect the comments or navigation parts.

Categories