BuddyPress login box on header

Hi!

I already talked to some of you guys about inserting a buddypress login box at my header (so it’s displayed at every page of my site). I have marketpress and buddypress on a multisite installation and I’m using PRO Theme, developped by Nathan Onn (one of you too). Patrick told me that buddypress has been compatible with any theme for a while, so I’m presuming the issue isn’t the theme. At first I just wanted to have a login box that would allow users to register and log into my site, but I’ve concluded that the easiest way is to have buddypress since it already comes with many features I’d be inserting anyway. The thing is: after installing bp, I didn’t see any differences at my site (didn’t see the bp login box, for instance). Patrick passed me some links directing to pages at my site that should be visible if bp was set up correctly and they all were -I had it installed once, then uninstalled, and now that I’ve installed it again it seems it “already came set up”, so I didn’t have to associate pages and stuff like that.

I’m telling the whole story here to make things easier for the WPMU folks. The closest I’ve come to a solution so far (instructed by the staff through live chat) was using this tutorial: http://codex.wordpress.org/Function_Reference/do_shortcode to insert a bp login box shortcode at my header.php, the shortcode for the login box being extracted from this plugin: https://wordpress.org/plugins/bowe-codes/. Entering the 9th minute of the video shown on that last page, the dev starts talking about the shortcode for the login box.

Summing it up: how do I insert the buddypress login box at my header?

Thanks.

  • Vinod Dalvi
    • WP Unicorn

    Hi @Gabriel Calil,

    I hope you are well today and thank you for your question.

    how do I insert the buddypress login box at my header?

    I don’t think there is any separate log in system for buddypress, it uses default WordPress log in system.

    You can use the wp_login_form function to display log in form in the header by adding following code in the header.php file of your child theme.

    if (!is_user_logged_in()){
    wp_login_form();
    }

    Kind Regards,

    Vinod Dalvi

  • AidMyAds
    • WordPress Warrior

    Hi.

    I meant that login box that used to be displayed automatically after installing buddypress, for the first versions. With this code you gave me, having in mind that I have buddypress installed in my site, will users be able to participate in the site’s forums, set up their own accounts and do the whole “buddypress kind of thing”? I mean, as long as I have buddypress installed, will that simple login code for wp do the trick?

    Thanks.

  • AidMyAds
    • WordPress Warrior

    I did it and all I’m seeing is the text below being displayed at my header:

    if (!is_user_logged_in()){ wp_login_form(); }

    I’m using pro theme, from Nathan Onn (marketpressthemes.com). In the link I posted to the site of a plugin to insert buddypress shortcodes, there’s a video tutorial that, at around 8:30 min, starts talking about inserting that login box I’m talking about; I just really didn’t understand what I have to do exactly to obtain the mentioned shortcode or where to insert it.

    Thanks.

  • AidMyAds
    • WordPress Warrior

    Same thing happened: I’m just seeing the code witten at my header, no login box. Below is a piece of my header.php, at which you can see where I’ve inserted the shortcode. I think I have to be doing something very wrong here, cause as far as I know this was supposed to be simple, haha.

    <!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>

    echo do_shortcode('[bc_login_signup="1"]');

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
    <title><?php mpt_load_site_title(); ?></title>
    <meta name="description" content="<?php mpt_load_meta_desc(); ?>" />
    <meta name="keywords" content="<?php mpt_load_meta_keywords(); ?>" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <?php mpt_load_google_web_font( true ); ?>
    <link rel="shortcut icon" href="<?php mpt_load_favicon(); ?>" />
    <link href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" rel="stylesheet" />

    <?php wp_head(); ?>

    <?php include(get_template_directory() . '/admin/custom-styles.php'); ?>

    <!--[if gte IE 9]>
    <script src="https://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <style type="text/css">.gradient {filter: none;}</style>
    <![endif]-->

    <?php mpt_load_header_code(); ?>

    </head>

    <body id="body-wrapper" <?php body_class(); ?>>

    Thanks.