Re: problem with using the home theme as a user theme
Hi Kunal17, I use prologue theme as default user theme and I also wanted to keep the login form on top, so I added this to the header of the prologue theme:
<div id=”search-login-bar”>
<?php if ( is_user_logged_in() ) : ?>
<div id=”logout-link”>
<?php bp_loggedinuser_avatar_thumbnail( 20, 20 ) ?>
<?php bp_loggedinuser_link() ?>
<?php
if ( function_exists(‘wp_logout_url’) ) {
$logout_link = ‘/ root_domain ) . ‘”>’ . __( ‘Log Out’, ‘buddypress’ ) . ‘‘;
} else {
$logout_link = ‘/ root_domain . ‘/wp-login.php?action=logout&redirect_to=’ . $bp->root_domain . ‘”>’ . __( ‘Log Out’, ‘buddypress’ ) . ‘‘;
}
echo apply_filters( ‘bp_logout_link’, $logout_link );
?>
<?php do_action( ‘bp_login_bar_logged_in’ ) ?>
</div>
<?php elseif ( get_option(‘users_can_register’) ) : ?>
<form name=”login-form” id=”login-form” action=”<?php echo $bp->root_domain . ‘/wp-login.php’ ?>” method=”post”>
<input type=”text” name=”log” id=”user_login” value=”<?php _e( ‘Username’, ‘buddypress’ ) ?>” onfocus=”if (this.value == ‘<?php _e( ‘Username’, ‘buddypress’ ) ?>’) {this.value = ”;}” onblur=”if (this.value == ”) {this.value = ‘<?php _e( ‘Username’, ‘buddypress’ ) ?>’;}” />
<input type=”password” name=”pwd” id=”user_pass” class=”input” value=”” />
<input type=”checkbox” name=”rememberme” id=”rememberme” value=”forever” title=”<?php _e( ‘Remember Me’, ‘buddypress’ ) ?>” />
<input type=”submit” name=”wp-submit” id=”wp-submit” value=”<?php _e( ‘Log In’, ‘buddypress’ ) ?>”/>
<input type=”button” name=”signup-submit” id=”signup-submit” value=”<?php _e( ‘Sign Up’, ‘buddypress’ ) ?>” onclick=”location.href='<?php echo bp_signup_page() ?>'” />
<input type=”hidden” name=”redirect_to” value=”http://<?php echo $_SERVER[‘SERVER_NAME’] . $_SERVER[‘REQUEST_URI’] ?>” />
<input type=”hidden” name=”testcookie” value=”1″ />
<?php do_action( ‘bp_login_bar_logged_out’ ) ?>
</form>
<?php endif // get_option(‘users_can_register’) ?>
<div class=”clear”></div>
</div>
You can maybe replace the
<div id=”search-login-bar”>
<?php bp_login_bar() ?>
<div class=”clear”></div>
</div>
part of your header.php file with the first code and I hope it will work for you.