Connect with us

How to use the Profile Builder plugin for User Login

solution

How to use the Profile Builder plugin for User Login

So, you have installed WordPress, in a breeze. Great, congratulations! Now you start to explore and everything seems to fabulous, until … Until you log out, what a surprise – you are greeted by WordPress!  Did WordPress hijack my site?

Does WordPress have to remind visitors the site is powered by WordPress? Or worse, visitors could mistaken your sites being run by WordPress.

If you happen to remove the META widget, without a login plugin, you will have to manually type yoursite/wp-login.php to re-login, again under the glaring WordPress Logo.

Not sure if this is by intention or by omission, this is one of the most amateurish features of WordPress.  For a very popular software, such as WordPress, it is unfathomable.

Among all the CMS’, WordPress is the worst in this regard.

Right away, you have to start to find a solution, a theme or a plugin. Countless hours have been wasted in finding and testing a suitable plugin. What did you get? Not much and none of them will work out of the box as desired.

Eventually, we settled on Profile Builder.  The selection of Profile Builder is not just related to the login issue but also due to two other important issues that will be discussed later in other TIPs.

Profile Builder has a basic and a pro version.  Pro version is your choice if you want to save time and also it offers more features that you may find very useful.

This TIP covers the basic version only.

For detailed instruction, please check with
https://wordpress.org/extend/plugins/profile-builder/

To use this tip, you will need to have to edit some of Profile Builder files and wp-login.php file.

READ  Top 10 Best Contact Form WordPress Plugins

Before you proceed, ALWAYS and ALWAYS back up files first, if anything goes wrong, you can always replace the change file with your backup file.

You need to create four pages (be sure to name them exactly as the following if you wish to use modified files below)

edit-profile, login, register, and lostpass

After the creation of the four pages, you may well need to remove them from your navigation menu.  Check with your theme designer if you cannot remove yourself.

Now we need to integrate login, register and logout links into theme.

For this site, they are integrated into the header (header.php) at the top right corner.

Copy and paste the following codes to the place of your choice in your header.php.

<?php if ( !is_user_logged_in() ) { ?>
<a href=”/register/” rel=”nofollow”>Register</a>
&nbsp;
<a href=”/login/” rel=nofollow>Login</a>
<?php } else { ?>
Welcome,&nbsp;
<a href=”/edit-profile/” rel=”nofollow”>
<?php
global $current_user;
if ( isset($current_user) ) {
echo $current_user->user_login; } ?> </a>
&nbsp;
<a href=”<?php echo wp_logout_url( home_url() ); ?>” title=”Logout” rel=”nofollow”>Logout</a>
<?php }?>

Now we have a workable login/logout mechanism.

What does this TIP do?

It replaces WP default register and login page with login, register, and edit-profile pages that match your theme.  No need to worry about using a plugin just to remove the glaring and mistaking WP logo.

There are still problems with this implementation:

  • After registration, we would like to be redirected to login page
  • After login, we would want to be re-directed to home page
  • At the login page, we want to use lost pass page you just created, not the default WP lostpass page.
READ  Best Responsive Review WordPress Themes

The basic version will not be able do these, as it lacks custom re-direct function. If you are using Pro Version, you can set the re-directs. Otherwise, you will need to edit the following two files:
wp-content/plugins/profile-builder/front-end/wppb-login.php
wp-content/plugins/profile-builder/front-end/wppb-register.php

Locate login re-redirect, lost pass link and register re-direct and make appropriate changes.

To force all registration through Profile Builder register page, you need to add one line

wp_redirect( site_url(‘/register/’) );

to
Yoursite/wp-login.php

The line should be added after this code:
<?php
login_footer(‘user_pass’);
break;

case ‘register’ :

Changing core files is not preferred, but in certain cases you have no choice but change them. Alternative, you can use loads of plugins just to do little things. Keep a record of what you have done for future reference.

TIP Summary

TIP: use Profile Builder as front-end registration, login and edit profile pages

This TIP has been tested, but as with all our tips and hacks, USE IT AT YOUR OWN RISK.

Continue Reading
You may also like...

We are a WordPress plugin developer company that focuses on useful WordPress plugin creation and empowering people to earn passive incomes from their blogs. We build unique and groundbreaking plugins that will revolutionize your blog!

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

More in solution

    Sign up for our newsletter and get a free affiliate e-book!


    About Me:

    Teodor Coste

    Hi, my name is Szabi and I'm documenting my journey selling plugins on CodeCanyon. I will show you every step of it: learning to code, plugin ideas, WordPress stuff and more. Read more…

    Mega Plugin Bundle:

    CodeCanyon Portfolio:

    Learn to Code Plugins:

    Latest Promotions:

    Recommended Theme:

    Start Your Own Blog:

    Recommended VPN:

    Translate Your Blog:

    AdSense Alternative:

    Best Article Spinner:

    Popular Posts:

    Latest Posts:

    To Top

    Privacy Preference Center

        Necessary

        Advertising

        Analytics

        Other