Hi mate thanks for the review! You actually can make templates in your theme folder, it’s only documented in the changelog though 🙂
Custom templates. You can now override the download templates in your theme. Create a new folder inside your theme directory called “somdn-templates”, and follow the same template folder/file structure as found in the plugin’s “Templates” folders.
Thanks so much for that @rwebster85. Was just about to go live so that’ll be really handy to fix right now!
Really good plugin though mate. Struggled to find anything that dealt with the Reset Password form so well. Keep up the good work and better update the docs. Pretty sure others would appreciate it 🙂
@rwebster85
Just put lost_password_form.php in somdn-templates folder in the root of my child theme and doesn’t seem to override? Any ideas?
Cheers
Woops sorry my mate, I thought this was a review for my other plugin…..
I will add in custom templates for this plugin tomorrow for you 🙂
@rwebster85 LOL! Not a problem and cheers for offering to add this feature in. That’ll be fantastic. Looking forward to the update 🙂
@rwebster85 Any update on the above? Just gone live would love to get this updated so future updates are no problem. Thanks
This is now live in version 1.1.8 🙂
Create a new folder inside your theme directory called somfrp-templates
, and follow the same template folder/file structure as found in the plugin’s templates
folder.
Hi @rwebster85
Just loaded but wasn’t working with child theme. Checked out the template function and noticed a filter so I placed the following in my child theme functions.php and bingo works like a dream 🙂
// filter frontend password reset template for child-theme
function filter_somfrp_get_templates($templates) {
if (get_template_directory() === get_stylesheet_directory()) {
// parent theme;
$theme_path = get_template_directory();
} else {
//child theme;
$theme_path = get_stylesheet_directory();
}
$templates = array(
'lost-form' => array(
'path' => SOMFRP_PATH . 'templates/lost_password_form.php',
'custom_path' => $theme_path . '/somfrp-templates/lost_password_form.php'
),
'reset-form' => array(
'path' => SOMFRP_PATH . 'templates/lost_password_reset_form.php',
'custom_path' => $theme_path . '/somfrp-templates/lost_password_reset_form.php'
),
'form-complete' => array(
'path' => SOMFRP_PATH . 'templates/lost_password_reset_complete.php',
'custom_path' => $theme_path . '/somfrp-templates/lost_password_reset_complete.php'
)
);
return $templates;
}
add_filter( 'somfrp_get_templates', 'filter_somfrp_get_templates', 10, 1 );
Maybe you could add the bit of code that I wrote to check if the theme is a parent or child to your next update, then no filtering would be needed? 😉
Cheers for the update though, that’s great!
Sure thing mate I’ll add that in 🙂
Version 1.1.91 now includes support for child theme templates 🙂
@rwebster85 Many thanks for adding this in. Works like a charm 🙂