add this to child functions.php or wp-content/meso-custom-functions.php
<?php
function meso_add_top_loginform() { if( !is_user_logged_in() ) {
echo '<div id="mobile-login">'. wp_login_form('echo=0') . '</div>';
} }
add_action('bp_before_top_nav','meso_add_top_loginform');
function meso_add_top_loginform_css() { if( !is_user_logged_in() ) {
echo '<style>'; ?>
@media only screen and (min-width:640px) {
#mobile-login { display:none;}
}
#mobile-login {margin:1em 0;float:left;width:93%;padding:2%;background:#f7f7f7;border:1px solid #ccc;}
#mobile-login p {float:left;display:inline;margin:0.6em 0.6em 0 0;}
<?php echo '</style>';
} }
add_action('wp_head','meso_add_top_loginform_css');
?>
Thanks Richie,
I don’t know why it just worked in function.php , I have tried to put into child functions.php and nothing happened. One more question is that I have a social login plugin installed, is it possible to integrate within the login password field, maybe left to the “login” button ?
my current login page for example: http://hkbabycircle.com/wp-login.php
Many thanks !!!!!!!!!!!
One more question is that I have a social login plugin installed, is it possible to integrate within the login password field, maybe left to the “login” button ?
seem like core edit needed…or the plugin edit need..no clue..need to ask plugin dev on this.
Hi Richie,
I’ve found some information (Custom integration) related to the plugin , it state:
If you want to add the widget to another location in your website, you can insert the following code in that location:
<?php do_action( ‘wordpress_social_login’ ); ?>
so, where should I put this code integrated?
many thanks ~~~
not sure, you’re looking to add social login in wp-login.php, that’s core related hook not theme. if its the theme login form, add the code in the previous code i mention above.
function meso_add_top_loginform() { if( !is_user_logged_in() ) {
echo '<div id="mobile-login">'. wp_login_form('echo=0');
do_action( 'wordpress_social_login' );
echo '</div>';
} }
add_action('bp_before_top_nav','meso_add_top_loginform');
YOU ARE SUPER, RICHIE !!!!!!!
that’s really nice!!
I have one more question, how to make “connect with X X <–social login icon” to next line not same line with login button ? ( in html is
)
many thanks & appreciated !!!!!
maling
i don’t think you can since login_form is wp functions, you can’t add filter inside it, only after.