Skip Navigation

[Resolved] Styling user wpv forms

This support ticket is created 5 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by roulartaM 5 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#1346851
user-login.png
admin-login.png

Hi Support team!

Can you guide me how to change/style the [wpv-login-form], [wpv-forgot-password-form] and [wpv-reset-password-form] forms? I've already searched Google to find out how to do this but it's not clear to me. In another topic, a collegue referred that those forms are WordPress forms and that they should be changed in functions.php. But when I do some login form changes for example, it has no effect on the "wpv"-forms.

In attachment, two screenshots of login forms. The first is the normal login form (admin-login.png), the second is the [wpv-login-form]-form (user-login.png). As you can see, the second form has no styling at all. The errors when fields are empty are not the same too...

How can I change and style those tree forms? How can I wrap some divs around the input fields? Can I change the error messages? Can I change the link in the mail after the user have done an input of their e-mail address in the [wpv-forgot-password-form] form?

Thanks for helping me out with this 🙂

#1346973

Hello,

Q1) How can I change and style those tree forms? How can I wrap some divs around the input fields?
There isn't such kind of built-in feature within those shortcodes, see our document:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-login-form
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-forgot-password-form
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-reset-password-form
There isn't option for wrapping divs around the input fields

But is should be very easy to style those input fields with CSS codes, for example [wpv-login-form]:
You can use style the login name field and password field, like this:

#user_login{
/* login name field, here add your custom CSS codes */
}

#user_pass{
/* password  field, here add your custom CSS codes */
}

More help:
hidden link

Q2) Can I change the error messages?
Which error message do you want to change?
For example, in shortcode [wpv-login-form], error message: The password field is empty.
You can use WordPress filter hook "gettext" to translate it into other text, like this:

add_filter( 'gettext', 'my_custom_message', 20, 3 );
/**
 *
 * @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
 */
function my_custom_message( $translated_text, $text, $domain ) {

    if ( $domain == 'wpv-views' ) {

        switch ( $text) {

            case 'The password field is empty.' :

                $translated_text = __( 'my own The password field is empty.', 'theme_text_domain' );
                break;

            case 'The username field is empty.' :

                $translated_text = __( 'my own The username field is empty.', 'theme_text_domain' );
                break;
        }

    }

    return $translated_text;
}

More help:
http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext

Q3) Can I change the link in the mail after the user have done an input of their e-mail address in the [wpv-forgot-password-form] form?

This email is sent by WordPress, so you can use WordPress built-in filter hook "retrieve_password_message" to change the email content, for example this thread:
https://wordpress.stackexchange.com/questions/321025/how-can-i-modify-the-default-reset-lost-password-email-text

More help:
https://developer.wordpress.org/reference/hooks/retrieve_password_message/

#1349813

My issue is resolved now. Thank you!