WordPress.org

Ready to get started?Download WordPress

Forums

CSS class for password-protected form (4 posts)

  1. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    Can a class be added to the form that is displayed when a post is password protected, please? As it currently stands, it's impossible to selectively style any of the elements in the form.

  2. elfin
    Moderator
    Posted 3 years ago #

    I think this will work, not adding a class to the form itself, just wrapping it in a quick div for styling.

    add_filter('the_password_form','my_password_form');
    function my_password_form($text){
    $text='<div class="myform">'.$text.'</div>';
    return $text;
    }

    untested.

  3. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    Yes - that does help. But, ideally, the class should be on the form itself. All of the other front-end forms have either an id or a class - why not this one? Seems to be a much neglected corner of WP...

  4. elfin
    Moderator
    Posted 3 years ago #

    raise a trac ticket?

Topic Closed

This topic has been closed to new replies.

About this Topic