Wordpress

Place a login form in the sidebar

Skip the login page. Want to log in through the front page? If yes then this tutorial is perfect for you. First, let’s see how it actually looks like. I tested it with my Lust WordPress theme on two local WordPress installs, version 2.1 and 2.2.

Here’s the login form in the sidebar:

sidebar login.png

Here’s the message after you’ve logged in:

admin logged in

And here’s what a logged in subscriber would see:

user_logged.png

So how do you put a login form in the sidebar? Simple, I did the work for you. Copy and paste the code in sidebar_login.txt to your sidebar. The URLs generated by this code is compatible with WordPress version 2.1 and up only. 2.0 and earlier versions are not compatible.

This technique is especially useful if you’re tired of having to go to the login page or if your blog place great importance on getting readers to register for accounts and actually log in.

Source: The original code was from MW WordPress theme by Javier García. I restructured and modified the code for a WordPress-like sidebar structure and valid XHTML.

Thanks! I don’t actually have the subscribers option turned on right now on my blog, but this is something I’d consider using in the future or on a different project. Also, I really appreciate the fact that you took the time to make sure it was valid XHTML, it is annoying to add something someone else made to your site only to find out that you need to modify it to make it valid like the rest of your pages.

clever. :)
you should package it up as a widget!

I didn’t come up with it. I modified the original code so it could work with most themes. Widget conversion is a good idea. I’ll look into it tomorrow morning.

Ketah:

Good job ! :-)

Merci beaucoup !

Yes, I hope also in a widget version. Good work.

Tyler:

Will this work with any theme, or just Lust?

With most themes

It’s look useful. I try it. Thanks a lot

I’d like to echo this becoming a widget, when you get time. Thanks.

[…] How to manually place a login form in the sidebar tutorial […]

hi small potato,

i’ve put this in my sidebar, but what i’m looking at now is using some kind of thickbox/lightbox function to display the same output as is in my sidebar now, but in an overlay.

Ive already tried thick box, but with no success, the display was wierd – a mix of php and html display.

how would you recommend i do this?
thanks

Thanks a lot

[…] How to place a login form in the sidebar » WPDesigner Como poner el formulario de ingreso en el sidebar de un WordPress (tags: wordpress login form howto) Archivado en: Links Diarios   |   Etiquetas: No Tags. […]

This would be very useful to me if it was widgetized as I want easier login access for my visitors so that they can add articles to my website. I am thinking of using your wpdesigner theme for one of my WordPress sites too.

Keep up the good work…

M8, I really have to call you m8, this is what I have been missing for almost a year I have been LOOKING from something that would make this possible. (King plug-in are not in my likings at all) anyways, first of THANK you!

Secondly if you ever decide to take this to the next level which I would say is a widget then that would be a one of the kind widget. Also including the register and recover screens into this would take WordPress to an entire new experience at least in my point of view! :)

Again, cheers for your effort! //Daniel

Oh another thing, Is it only me getting a “•” before the title? (see http://www.aypeus.org for live show) If not any chance this can be removed?

Searched the theme CSS file, found nothing, the code itself doesn’t contain it (well I can’t find it).

If anyone knows anything or so please feel free to contact me via e-mail aypeus@aypeus.org

alias:

I notice you yourself do not have a login form on your sidebar ? ?

That’s because I rather not place the login form in the sidebar right now.

alias:

is there way to set this up so register does not have to be enabled ? I notice when you disable it the form no longer appears,

m-alo:

Very useful tutorial. Thank You!

this looks really useful. Thank you for making it available.

Two questions. First, could I put this in a php-enabled sidebar widget? Second, if a person who is not registered tries to login, will the form take them to the registration page?

Thanks again. I hope to get it working soon.

Rosina – I’ve packaged it as a widget. If someone without an account tries to login, it takes that person to the failed login page.

kaiser:

Hi.
i got a little problem. When i´m not logged in, i don´t see the … but when i´m logged in, everything is allright. i put write post, write site, etc. instead of dashboard, because i use it for an intranet. any suggestions?

If you need help, use the Wpdesigner forums.

kaiser:

Hi again,
could you activate my forum-account, so i can add the question there? thanks.

Kaiser – Your forum account was deleted because you used an invalid email address.

I don’t exactly know what you problem with the login form is, but it simply sounds like you don’t see the same set of links when you’re logged in versus when you’re logged out.

That’s normal. The list of links that you do get to see depends on whether you’re logged in and whether you’re the blog’s administrator.

kaiser:

Hi, Small Potatoe. Do you want me to try again? It´s the same adress used here in the posts. It works normaly without problems: der.kaiser [at] gmx.at

The problem is not that easy. It´s not that i just see a different list. I can´t see anything, than the dot described by aypeus a little bit before me. You can see it over here web101 [dot] cbel [dot] de/josephhaydn/ when you look on the index-page in the section called ‘join’.

Aypeus solved it, but didn´t say how. So maybe you can help? Thanks a lot!

…it’s difficult for me to come up with a solution because I don’t know what’s causing the problem.

It looks like you have a login link in the place of the login form, which was not a part of the login form code that I gave you through this post.

What’s causing the problem probably has to do with your modifications to the original code. Maybe if…else conditionals are not set up right?

kaiser:

Hi Small Potatoe,
i got some advice by aypeus, who recommended a widget. it´s not that far from yours, because it got the same functions: blue-anvil [DOT] com/archives/ a-wordpress-login-widget-sidebar-login-widget-v10

…and works. i´m no programmer (but i can handle css and html without any problem ;) and only saw one minor difference: you make use of

Hey, Their
I had a question which I cannot seem to locate an answer. I am trying to incorporate a “Leave Reply” box into my web page(blog).
Exactly like yours. I read the above tutorial, which is excellent! I’d really like to resolve this issue before I proceed with more upgrades.
I really appreciate any feedback you migh have to offer.
I tried changing the script in comments.php/ but I notice it has a redirect to the worpress login screen. I tried adopting the WP default files of comments.php and comment-popup.php. I’ve had no luck.

Thank you

Disregard my previous post – I realize it the “Leave a reply” box/field disapprears when you select users must be logged in to post comments.
(MY bad)

Many times I have tried many themes,

Some designers ‘forget a home or login’ button. Typical is the Hemingway which I did ask Worpress.com to edit the theme to include a button last year ~grins~ but I see its not been done which is a pity as I love a black theme. Hemingway is not the only designer to do this.

Obviously we need to get back home after reading more, or to at the very minium the admin area so this widget will be great.

Of course it would only work as a widget on a widget enabled theme..lmaooooooo I guess you could do what small potato did before he did the widget and follow the tutorial and code it by hand.

Either way SP is the star of the day, well done SP!

Just realised also China Red has no ‘home’ button — pity its such a beautiful theme from biged.

I decided to create a button called ‘home’ which worked but other problems prevent me from using China Red much to my sadness.

Does this code works with WP MU? I put the code in sidebar, it works when i am logged in. When i am not logged in, it does not shows login form. Ideas?

i never tested it in wpmu

Waow, once more you’ve made me exciting… Thanks, Mr Potato

Brad Bolman:

Sorry if this has already been asked, but does this/ is it possible to add ajax to this so you don’t need a page reload?

I don’t know.

[…] WPDesigner » How to place a login form in the sidebar (tags: blogging blog wordpress) […]

[…] I have found the code for those requirements quite fast. I just had to make it ready for The Morning After. If you share […]

disman:

Buddy!
Great work!!! I really appreciate this…saved me a lot of freakin’ time :-)
Dis

Thanks found it very helpful !

[…] How to place a login form in the sidebar (Source: WP […]

Fantastic Post! Thanks so much.

[…] How to place a login form in the sidebar (Source: WP […]

[…] How to place a login form in the sidebar (Source: WP […]

[…] WPDesigner » How to place a login form in the sidebar (tags: wordpress howto login sidebar php code css toread) […]

[…] How to place a login form in the sidebar- Want to get your users log in through the front page, Small Potato’s tutorial will show you […]

Thank for the code, it is really nice to have it on sidebar for easy navigation.

Just one Q: when I use it on my theme it seems that on IE6 the input area for both user & password are of different sizes. Did I do anything wrong?

Thanks, again.

Thanks! Using this code in combination with Jquery has let me create a really nice login feature for a client. Way to go!

[…] – ?o?n mã c?a file sidebar_login.php ???c l?y t? Theme MW WordPress Theme, ?nh và n?i dung bài vi?t ???c l?y t? WPDesigner.com […]

Thank you Thank you Thank you! You just made my day!

[…] when you refresh the page only to find that it’s decided to revert to the default theme? 2) How to place a login form in the sidebar- Want to get your users log in through the front page, Small Potato’s tutorial will show you […]

[…] How to place a login form in the sidebar […]

Thanks a lot for great script. It’s work so nice.

THANKS AGAIN

[…] WordPress Comments and Trackbacks. 89. Customize your WordPress Login. 90. Date Image Hack. 91. How to place a login form in the sidebar. 100. WP: KeyBoard Shortcuts. 101. Making Better Use of Your Error “404? Page. 102. Customize […]

Hey Potato – it works great (and thank you VERY much) but just a heads up:

I’m currently experiencing a ‘submit’ for non-authenticated users error in Internet Explorer.

When a user hits submit on a comment, it triggers a non-logged-in user to log into the wordpress login screen (exactly what I didn’t want.)

I’m trying to fix it but I’m banging my head against a wall.

[…] How to place a login form in the sidebar- Want to get your users log in through the front page, Small Potato’s tutorial will show you […]

i really want to use this stuff but is this compatible now with 2.5.1 wp release??.. hope you can shed the light..

[…] WordPress Comments and Trackbacks 89. Customize your WordPress Login 90. Date Image Hack 91. How to place a login form in the sidebar 100. WP: KeyBoard Shortcuts 101. Making Better Use of Your Error “404? Page 102. Customize Your […]

gattey wan:

This would be very useful to me if it was widgetized as I want easier login access for my visitors so that they can add articles to my website. I am thinking of using your wpdesigner theme for one of my WordPress sites too.
This would be very useful to me if it was widgetized as I want easier login access for my visitors so that they can add articles to my website. I am thinking of using your wpdesigner theme for one of my WordPress sites too.

This would be very useful to me if it was widgetized as I want easier login access for my visitors so that they can add articles to my website. I am thinking of using your wpdesigner theme for one of my WordPress sites too.

Keep up the good work…

[…] Separate WordPress Comments and Trackbacks89. Customize your WordPress Login90. Date Image Hack91. How to place a login form in the sidebar100. WP: KeyBoard Shortcuts101. Making Better Use of Your Error “404? Page102. Customize Your 404 […]

[…] Place a login form in the sidebar […]

[…] 22????? […]

[…] 22????? […]

[…] 22????? […]

[…] 22????? […]

[…] 22????? […]

[…] 22????? […]

[…] Place a login form in the sidebar […]

[…] 22????? […]

[…] Pon un login en tu sidebar( o donde quieras) […]

[…] 31. Colocar un formulario de login en la barra lateral […]

[…] Sidebar’a login form koyun […]

[…] Place a login form in the sidebar […]

[…] Sidebar’a login form koyun […]

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s