Тёмный

Step by step to create WordPress Custom Login Page Without Using a Plugin - Right Way in easy steps 

Online Web Tutor
Подписаться 25 тыс.
Просмотров 50 тыс.
50% 1

WordPress is one of the most widely use Blog Engine today and many web developers are using WordPress
as CMS to build Blog, Personal and Business site, on past few days, I was working on a WordPress
site that needs Custom Login page functionality, you may see a lot of plugins out there to create
WordPress login page but this tutorial might helpful to all web developer who interested to learn in
WordPress.
#WordpressTutorialsPoint
#WordpressLearnersHub
#WordpressCustomizations
#LearnWordpressStepbyStep
#WordpressBySanjay
In this tutorial, I will explain how to make a WordPress custom login page without using any plugin.
Steps to make custom login page
===========
1. Make a Wordpress page
2. Make a template in theme's folder
3. Assign created template to Wordpress page.
4. Do code of login on Template file
5. Need to change some redirect urls after logout or for wp-admin
PHP code
================
This contains php script to validate and accept posted data from our HTML form.
global $wpdb;
$err = '';
$success = '';
if(isset($_POST['task']) && $_POST['task'] == 'login' )
{
//We shall SQL escape all inputs to avoid sql injection.
$username = $wpdb-]escape($_POST['log']);
$password = $wpdb-]escape($_POST['pwd']);
$remember = $wpdb-]escape($_POST['remember']);
if( $username == "" || $password == "" ) {
$err = 'Please don\'t leave the required field.';
} else {
$user_data = array();
$user_data['user_login'] = $username;
$user_data['user_password'] = $password;
$user_data['remember'] = $remember;
$user = wp_signon( $user_data, false );
if ( is_wp_error($user) ) {
$err = $user-]get_error_message();
exit();
} else {
wp_set_current_user( $user-]ID, $username );
do_action('set_current_user');
echo '[script type="text/javascript"]window.location='. get_bloginfo('url') .'[/script]';
exit();
}
}
}
Confused
============
Okay, let me explain further the lists of WordPress function we’re using.
is_wp_error: this will check whether variable is a WordPress Error.
wp_set_current_user: We use this wordpress built in function because many user report when using
wp_signon() function logs a user in but for some reason the global user variables such as $current_user
and $user_ID are not populated until the page is refreshed and calling get_currentuserinfo() doesn’t
populate as well. The is_user_logged_in() function also returns false.
Important Videos to watch:
Customize Wordpress Login Page: • Step by step to Change...
Wordpress Widget development in 1 video: • Complete tutorial for ...
SOCIAL :
===============
Subscribe : / @onlinewebtutor
FACEBOOK : / onlinewebtutorhub
TWITTER: / owthub
BLOG: onlinewebtutorhub.blogspot.in/
Also you can learn Wordpress Custom
===============
Wordpress Theme Development: goo.gl/MZ8maF
Wordpress Widget Development: goo.gl/Dc2htn
Wordpress Plugin Development: goo.gl/BA7dYG
Wordpress Theme Options Development: goo.gl/Vjv3Ub
Learn backbone.js here! : goo.gl/Qd2Pcs
Tags
===============
WordPress Custom Login Page,
customize wordpress login page without plugin,
How to Create a Custom Login Page for WordPress,
Build a Custom WordPress Login,
How to Build a Custom-Made WordPress Login Page,
wordpress custom login url,
step by step login page development in wordpress,
wordpress custom login page tutorial in easy steps,
wordpress custom login page,
customize wordpress login page without plugin,,
wordpress custom login form,
wordpress custom login form code,
online web tutor,
profotech solutions,
Thanks
Online Web Tutor
Keep learning and Sharing :)

Опубликовано:

 

26 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 91   
@danielholm5654
@danielholm5654 9 месяцев назад
Good man! Its hard to find a decent wordpress tutorials! everyone just makes you download a plugin to fix your problem. This is very helpful thank you Im subscribing to you. you deserve it!
@OnlineWebTutor
@OnlineWebTutor 9 месяцев назад
Thank you bro 😊
@elitny-varvar
@elitny-varvar 3 года назад
Exactly what i was looking for. 👍
@bendjebbalilia3329
@bendjebbalilia3329 4 года назад
Amazing tutorial,thanks !
@OnlineWebTutor
@OnlineWebTutor 4 года назад
Glad it helped!
@abdelilahhamdani5660
@abdelilahhamdani5660 4 года назад
Thank you So much!!! Awesome Tutorial, well explained
@OnlineWebTutor
@OnlineWebTutor 4 года назад
Thanks for your feedback
@hichem6901
@hichem6901 4 года назад
hello did you find the answer to your problem?
@MdSumon-fq8ro
@MdSumon-fq8ro 2 года назад
Awesome,,Thanks a lot
@janejames8955
@janejames8955 3 года назад
Hi Sanjay awesome tutorial! I have a syntax error at the bottom of my custom login.php file, are you able to share the code for the custom login.php file, the code you shared in the description is different.
@shaheenahamedpersonal
@shaheenahamedpersonal 4 года назад
Wow. So simple. Thanks dear.
@OnlineWebTutor
@OnlineWebTutor 4 года назад
Welcome
@zaofficial5369
@zaofficial5369 4 года назад
In a words.....................Awesome.
@OnlineWebTutor
@OnlineWebTutor 4 года назад
Thanks
@romabsd
@romabsd 4 года назад
thank you very much for a useful video!
@OnlineWebTutor
@OnlineWebTutor 4 года назад
Thanks for the great feedback
@leonziger2496
@leonziger2496 5 месяцев назад
thanks for your job
@OnlineWebTutor
@OnlineWebTutor 5 месяцев назад
Thanks friend 😊
@masterstudio4190
@masterstudio4190 4 года назад
Amazing tutorial! Can you share about custom forgot password and reset password pages?
@AnandJagtap1
@AnandJagtap1 5 лет назад
Thanks
@laxmigococociyuiptummala9098
@laxmigococociyuiptummala9098 3 года назад
Good tutorial and excellent explain thank you
@OnlineWebTutor
@OnlineWebTutor 3 года назад
Thanks
@tapasdeb1061
@tapasdeb1061 2 года назад
Thank your for your great tutorial, I have a question, how to show user name and logout instead of login button when it was logged-in. When i am create a new user it is not showing. Again, thank you for your detail and elaborate explanation.
@jyotiraj2674
@jyotiraj2674 4 года назад
Nice video thankyou very much..........
@OnlineWebTutor
@OnlineWebTutor 4 года назад
Welcome Jyoti
@tequilafree
@tequilafree 4 года назад
hey... great video! have you one similar to this which shows "custom register" process ?
@adamsmelcer3199
@adamsmelcer3199 4 года назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-LTNUSb_5zA8.html
@sagheermarwat2565
@sagheermarwat2565 4 года назад
how i can set individual password on personnel in (kingster theme).Faculty profiles are not editable. There should be a login and edit panel for faculty members?Can you suggest any third party plugin for this?
@AshfaqueSirBio
@AshfaqueSirBio 4 года назад
I have submitted you your are great
@OnlineWebTutor
@OnlineWebTutor 4 года назад
Thanks for your great comment.
@zubitechsol1884
@zubitechsol1884 6 лет назад
thanks for that am using wp-login code not wp signon i have only one problem that if i hit on submit button it will redirect to wp-login page and could not stay on custom page
@OnlineWebTutor
@OnlineWebTutor 6 лет назад
Hi @M Bilal Arshad, yes we also seen that there are some flows so please watch this video ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Rg9eg0rk0ZY.html . Hope this helps :) Thanks
@AshfaqueSirBio
@AshfaqueSirBio 4 года назад
I have fully watched your tutorial. But I want to redirect users to custom login link except me.
@tinngoquang6500
@tinngoquang6500 6 лет назад
I did exactly what you did, but i have the problem is if i access to the admin site it redirect immediately to the custom login page. But if i change $verify_user = wp_signon($login_array, true); to $verify_user = wp_signon($login_array, false); it work normally. Can you explain that ? Thank you for your lesson !
@OnlineWebTutor
@OnlineWebTutor 6 лет назад
Hi @Tín Ngô Quang , please can you try this login steps ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Rg9eg0rk0ZY.html, Hope this helps you :)
@muhammadkhurram4221
@muhammadkhurram4221 4 года назад
hello sir after doing the same thing what ever you have done in this tutorial ....after login to the site when I clicked on dashboard it show nothing i.e its not going to dashbord page.
@user-jt9fd5xc4p
@user-jt9fd5xc4p 4 года назад
I have the same problem.
@prathamkshirsagarMW
@prathamkshirsagarMW 2 месяца назад
Big Problem in this lecture when we click on wordpress deshboard its go to tha login page
@jeetu7013
@jeetu7013 4 года назад
If we click on dashboard its redirct login blank page give me solution please
@tanloctran2226
@tanloctran2226 6 лет назад
yesterday i did exactly what you did in the video and it work then today i cant use the custom login page. i can login normal but i cant acces to wp-admin page then after few minute it automaticly logout
@OnlineWebTutor
@OnlineWebTutor 6 лет назад
Ok @Loc Tran, thank you for your feedback. I will update you soon after checking.
@OnlineWebTutor
@OnlineWebTutor 6 лет назад
Hi @Loc Tran, please check this video ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Rg9eg0rk0ZY.html , let me know if this helps you. Thanks
@treenykim167
@treenykim167 6 лет назад
really helpful.but i have 1 question . i just followed. but after signin . when i want to click admin mode it just no reaction . so code change and i find out..didnt be login admin mode um..... i dont know how to do.
@kristelmagnaye6885
@kristelmagnaye6885 6 лет назад
same
@OnlineWebTutor
@OnlineWebTutor 6 лет назад
Hi @treeny @Kristel please find this video ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Rg9eg0rk0ZY.html , let me know if this helps you. Thanks
@sahilkhankhalilx2102
@sahilkhankhalilx2102 5 лет назад
make a video sir to to upload custom login created page to wordpress site
@user-rg3um5bw1t
@user-rg3um5bw1t 3 года назад
How do I display an error message when I fail to log in?
@westpapualiberation
@westpapualiberation 4 года назад
How can we create the login page from Filemanager ?
@OnlineWebTutor
@OnlineWebTutor 4 года назад
I didn't your point point, can you please explain more.
@mikemoy5245
@mikemoy5245 4 года назад
Nice Video, lots of detail. This video claims to be the "Right Way". It seems rather odd that the default php login file is not modified and instead a new login php file is created that we re-direct to when the default php file begins to load. Why is the 'Right Way' to begin loading the default php login file and re-direct to the new login page. One would think that the right way would be to modify the default login php file to gain the desired aesthetic/functionality. I mean it seems less efficient to begin loading the default login php file only then to re-direct to the new login php file. When testing this method of redirection on the wp-admin page I notice the introduction of some minor lag due to the fact it is not going directly to the new login php file but instead beginning to load the default login page and then re-directing to the new login page. Anyone with good technical knowledge able to explain why the method in the video is the "Right Way" ?
@albertmctorre4789
@albertmctorre4789 2 года назад
It's a good way to rank on youtube. obviously it's not the right way, it's one way. If you want to alter some aspects of the default login page this would be the way to go about it. If you plan to essentially keep the same html as the default login but only change the css, then you would be better served just changing the css of the default login page.
@khushbuprajapati3252
@khushbuprajapati3252 3 года назад
user login then click dashboard then dashboard not open and blank login screen open that is very big issue in your tutorial
@noumanmayo2601
@noumanmayo2601 6 лет назад
how to reset password by email ? is there any tutorial available ?
@OnlineWebTutor
@OnlineWebTutor 6 лет назад
Of course we can set password by email, but we have no videos right now :)
@mahbubhussaim1996
@mahbubhussaim1996 6 лет назад
How to set login error message on the same page?
@OnlineWebTutor
@OnlineWebTutor 6 лет назад
@Mahbub you can do it by using querystring. When you got any error message while login store those message somewhere for some moment and send error status code to query string. On login page, check if error status code is there in URL then show all message that have stored. Thanks
@Capitalglenn
@Capitalglenn 5 лет назад
23:57
@treenykim167
@treenykim167 6 лет назад
When i sign in admin mode .. aske me to sign in again ..just like automatic sign out. How to slove the problem?
@OnlineWebTutor
@OnlineWebTutor 6 лет назад
Hi @treeny, yes i have seen the flows of the video so please find this video ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Rg9eg0rk0ZY.html , let me know if this helps you. Thanks
@MansfeldPlPlus
@MansfeldPlPlus 4 года назад
I had the same problem. Just move your code with wp_signon() to functions.php
@hichem6901
@hichem6901 4 года назад
@@MansfeldPlPlus thanks but haw to get a "$_POST" information in function.php?
@nhriddhi8430
@nhriddhi8430 6 лет назад
how to make custom register page ?
@OnlineWebTutor
@OnlineWebTutor 6 лет назад
Hi @Riddhi, about custom registration in wordpress here you can find tutorial goo.gl/rCc2yY. Hope this will help you. Thanks :)
@gajendrasharma3516
@gajendrasharma3516 5 лет назад
login with otp in wp how to achieve
@OnlineWebTutor
@OnlineWebTutor 5 лет назад
Hi @gajendra sharma, for using OTP we have to use SMS API, you can find the paid and free services on internet. please find that
@gajendrasharma3516
@gajendrasharma3516 5 лет назад
sir i have sms key in twillo but how to integrated in wordpress please suggest tutorial and video how to use this key free plugin and custom code
@arshpreetkaur3032
@arshpreetkaur3032 4 года назад
I cannot understand how php coding has added
@OnlineWebTutor
@OnlineWebTutor 4 года назад
Where you are getting issue to understand buddy.
@gworld0
@gworld0 2 года назад
I have tested your code and its not working at all. When I click on submit button it redirect to default login page.
@bengareth
@bengareth Год назад
It's a set and forget video with no files and no response. I wish RU-vid would do something about this.
@humbulanimunonde9329
@humbulanimunonde9329 3 года назад
Do you have any promotional experience with EnotGlobal?
@jakepunton744
@jakepunton744 6 лет назад
This is secure?
@MansfeldPlPlus
@MansfeldPlPlus 4 года назад
Yes, because it use native WordPress method. Login in wp-login.php use similar way.
@bengareth
@bengareth Год назад
What's the point if you are not going to provide the code? You could at least go up and down the screen to allow people to check their work. You've even provided code for something else in the description whereas this would be better served in the comments with a link to the file in the description. I've just wasted an hour of my time slowing down the video as you speak way too fast, only to get to a point where there is an else block that is not expected and no way to check this as you have not provided a file. Sure, I could go and have a debate online, but it won't prove fruitful because it will just spark debates about the way the form goes about doing achieving the goal. For others, my comment is extremely critical because I have read at least one other person's comment where they became stuck, over a year ago, and there has been no response. How can we even be sure that this video is still valid? With these kind of videos, they should be maintained and removed once out of date not just made and forgotten when a particularly remit is not specified.
@RAILROADSONG0465
@RAILROADSONG0465 5 лет назад
Please speak clearly and slowly
@TheGoldenriff
@TheGoldenriff 4 года назад
This is not a very good tutorial. I think you need to do a bit more wordpress development before you make videos. Why are you echoing a script tag to redirect the user when there is the function wp_redirect(url) or the the php header(url) function. Also you don't want to post your forms to the same page, create a controller and post to that to relay back to your page via object oriented code.
@OnlineWebTutor
@OnlineWebTutor 4 года назад
Ok sure
@viralmaisuriya2952
@viralmaisuriya2952 Год назад
admin panel not open after this code it is redirect to else part of this if(!$user_ID)
@sanjitkumarmahato4914
@sanjitkumarmahato4914 5 лет назад
hello sir after doing the same thing what ever you have done in this tutorial ....after login to the site when I clicked on dashboard it show nothing i.e its not going to dashbord page.
@muhammadkhurram4221
@muhammadkhurram4221 4 года назад
same problem
@MansfeldPlPlus
@MansfeldPlPlus 4 года назад
Just move your code with wp_signon() to functions.php
Далее
Как вам наш дуэт?❤️
00:37
Просмотров 162 тыс.
Best Toilet Gadgets and #Hacks you must try!!💩💩
00:49
Новые iPhone 16 и 16 Pro Max
00:42
Просмотров 1,2 млн
13 Things To Remove From Your Website Immediately
12:33
Wordpress vs coding - why devs SHOULD learn Wordpress
11:03
Japanese web design: weird, but it works. Here's why
11:49
Form Submit Using Ajax - WordPress Form Ajax
1:09:25
Просмотров 18 тыс.
Don't Use Websockets (Until You Try This…)
6:46
Просмотров 291 тыс.
Как вам наш дуэт?❤️
00:37
Просмотров 162 тыс.