Posted: June 2, 2016 at 4:19 am
|
Hi, I’ve placed eea-wp-users-login-form.template.php in my child theme ‘u-desgin-child’ (u-desgin-child>eea-wp-users-login-form.template.php) and under u-desgin-child>eea-wp-user-integration>eea-wp-users-login-form.template.php. Yet the custom template isn’t working. Where else can I put this template file in my child theme so that it overrides the default template. Thanks |
Hi there, Currently the EE4 User Integration add-on does not allow you to override that template. Can I ask what you are looking to do with the template? |
|
|
hi Tony, I’m trying to remove the register link and replace it with a ‘forgotten password’ link. |
|
Hi Tony, the code to put the register button on the form is |
|
because there is a wordpress setting where you can turn off the ability to register, but will this break the events espresso wp user integration plugin? |
|
oh, and I guess that still won’t let me put a forgotten password link on there 🙁 |
Disabling that option should still allow EE to create users however as you mentioned it will not allow you to add forgotten password link. The template is loaded using the ‘display_template’ method which does not check for custom versions of the plugin, however there is a filter within that function that will allow you to check the current template and replace it with your own:
$template_path will be an absolute path to the template file, so you can hook into that, pull the current template file using I’ll check in with our developers but usually when we use display_template() to output a template it is to prevent changes to the template that could have a knock on effect and cause further problems. |
|
|
Hi Tony, thanks for that, I’ve attempted a function in my functions.php file:
but must be going wrong somewhere? Thanks |
|
Hi Tony, I have been thinking, it may be easier to just add a forgotten password button next to the login button. I’ve found what seems to be the action/filter that is giving the message when a user tries to checkout with an email that already exists: EED_WP_Users_SPCO__verify_user_access__perform_email_user_match_check and this outputs the message `$error_message = ‘<p>’ . __( ‘You have entered an email address that matches an existing user account in our system. If this is your email address, please log in before continuing your registration. Otherwise, register with a different email address.’, ‘event_espresso’ ) . ‘</p>’; /** So therefore I have tried to add more to the $error_message variable in my functions.php with the following code:
but it must be the wrong action, because it no longer gives the message. Do you know the action I can use in this case to just add the button to that warning. That would save using a custom template and might be an easier away to achieve a forgotten password link? Thanks. |
Allows you to return either true or false based on the $spco and $registration object and determines if the email/user check should be performed, it is not what you need here. (You could use the other, but its more complicated the loading your own template) I’m guessing you have not had much experience with WP hooks previously? (which is fine if that’s the case) You’re close but not using the hooks correctly. The first function you provided doesn’t actually do anything as your function is not hooked into the filter, I’d highly recommend taking read over this: https://www.smashingmagazine.com/2011/10/definitive-guide-wordpress-hooks/ As learning to use hooks correctly will help with almost all of your modifications. So the code here, should be something like this: https://gist.github.com/Pebblo/f5d9bfd66439d99d9cbe37558ac4b947 That will load the template from your themes root directory. Note that when requesting to override templates is it expected that you will keep up to date with any changes made within those templates to match our changes (plus you’re own) and we do not provide support for custom templates. (Although if we can we will advise on what we can see) |
|
|
Thank you, Nope, I’ve not been doing WordPress development for very long, I’ve only just started taking over from a colleague who used to deal with hooks and actions. Thanks for the guide and your code, it’s clearer to me now. |
You’re most welcome. |
|
The support post ‘user integration templates, child theme’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.