WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using the Sidebar Login script by Mike Jolley, I would like to add a class of "clearfix" to the element tag. I have been unable to find a solution to this so far.

I'd also like to understand any solution given, so if you would like to briefly explain how the function works I'd be very grateful.

share|improve this question
Add a link to the plugin’s source code. – toscho Jun 21 '13 at 10:24
up vote 1 down vote accepted

That plugin does not create a <form> tag itself. It uses wp_login_form to do that, and that function does not provide a way to add a class to the <form> tag. You can see that by looking at the widget method, which is what generates the front end content.

I don't see a way to do what you want to do, but there is an action before the form-- do_action( 'sidebar_login_widget_start' );-- and one after-- do_action( 'sidebar_login_widget_end' );-- that would let you wrap the whole form in some other markup.

However, I very much doubt that you need to add a class to that tag. I would bet that you can do anything you need by writing CSS rules using the existing markup.

share|improve this answer
Thank you ever so much for that explanation, I understand now :) And I have just realised how to accomplish what I need - apply the properties of clearfix to form instead of trying to add a class to it.. I do feel silly. I really do appreciate you taking the time to explain this to me. – Paxjah Jun 21 '13 at 13:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.