Adding a login widget location



Adding a social network login button, is highly popular these days, and it should be located next to the username and Password fields.

I have implemented a login widget for the Social theme (screenshot attached), right beneath these username and Password fields.

So, I was wondering, if you can add my code (or, your own code that provides similar functionality) to the theme’s next release?

I have done these 2 changes (I wasn’t able to attache the modified PHP files…:wink::

1. Added this function to the ./bp-social/functions.php:

function bp_social_add_widgets(){
global $bp_existed;
'name' => __('home-login', TEMPLATE_DOMAIN),
'id' => __('home-login', TEMPLATE_DOMAIN),
'description' => __('Home Login Widget', TEMPLATE_DOMAIN),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h2 class="widgettitle">',
'after_title' => '</h2>'
add_action( 'widgets_init', 'bp_social_add_widgets' );

2. Added to ./bp-social/lib/templates/wp-template/top-header.php (line 64):

<?php _e( 'Remember Me', TEMPLATE_DOMAIN ) ?>
<!-- Added by Roei: a widget for the facebook login button -->
<div id="home-login" class="box">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar( __('home-login', TEMPLATE_DOMAIN) ) ) : ?>
<div id="text" class="widget widget_text">
<h2 class="widgettitle"><?php _e( 'Home Login Widget', TEMPLATE_DOMAIN ) ?></h2>
<div class="textwidget">
<?php _e( 'Please log in and add widgets to this column.', TEMPLATE_DOMAIN ) ?>
 <a href="<?php echo get_option('siteurl') ?>/wp-admin/widgets.php?s=&show=&sidebar=sidebar-1"><?php _e( 'Add Widgets', TEMPLATE_DOMAIN ) ?></a>
<?php endif; ?>
<?php do_action( 'bp_login_bar_logged_out' ) ?>