Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

Support: Creating & Extending

Existing and new plugins/components and themes.

BuddyPress Login (account creation) Remove Div After Login (4 posts)

Started 11 months, 2 weeks ago by: Famous

  • Profile picture of Famous Famous said 11 months, 2 weeks ago:

    I would like to set the code below in a div and have the whole div disappear when someone logs in. Any ideas?

    <div class="madeUpDiv">
    
    <?php do_action( 'bp_before_sidebar_login_form' ) ?>
    
    		<p id="login-text">
    			<?php _e( 'To start connecting please log in first.', 'buddypress' ) ?>
    			<?php if ( bp_get_signup_allowed() ) : ?>
    				<?php printf( __( ' You can also <a href="http://mysite.com/register&quot; title="Subscribe" class="createAnAccountButton" rel="nofollow">Subscribe</a>', 'buddypress' ), site_url( BP_REGISTER_SLUG . '/' ) ) ?>
    			<?php endif; ?>
    		</p>
    
    		<form name="login-form" id="sidebar-login-form" class="standard-form" action="<?php echo site_url( 'wp-login.php', 'login_post' ) ?>" method="post">
    			<label><?php _e( 'Username', 'buddypress' ) ?><br />
    			<input type="text" name="log" id="sidebar-user-login" class="input" value="<?php echo esc_attr(stripslashes($user_login)); ?>" tabindex="97" /></label>
    
    			<label><?php _e( 'Password', 'buddypress' ) ?><br />
    			<input type="password" name="pwd" id="sidebar-user-pass" class="input" value="" tabindex="98" /></label>
    
    			<p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="sidebar-rememberme" value="forever" tabindex="99" /> <?php _e( 'Remember Me', 'buddypress' ) ?></label></p>
    
    			<?php do_action( 'bp_sidebar_login_form' ) ?>
    			<input type="submit" name="wp-submit" id="sidebar-wp-submit" value="<?php _e('Log In'); ?>" tabindex="100" />
    			<input type="hidden" name="testcookie" value="1" />
    		</form>
    
    		<?php do_action( 'bp_after_sidebar_login_form' ) ?>
    
    </div>/*endMadeUpDiv*/
  • Profile picture of @mercime @mercime said 11 months, 2 weeks ago:
    <?php if ( !is_user_logged_in() ) : ?>
    
    //your div.madeUpDiv here
    
    <?php endif; ?>
  • Profile picture of Famous Famous said 11 months, 2 weeks ago:

    Thank you, thank you @mercime

  • Profile picture of @mercime @mercime said 11 months, 2 weeks ago:

    You’re welcome :-)