Skip to content

password_protected_theme_file

Ben Huson edited this page Feb 28, 2014 · 3 revisions

This filter allows you to provide a path to a different login template.

This could be in your theme or packaged as a separate plugin. The example below shows had to add a custom Password Protected template to your theme.

Firstly, make a copy of the /plugins/password-protected/theme/login.php file in your current theme folder. You can rename this to whatever you like e.g. password-protected-login.php.

Then, in your theme's functions.php file add the following code which should return the path to the theme file you just created:

function my_password_protected_theme_file( $file ) {
	return get_stylesheet_directory() . '/password-protected-login.php';
}
add_filter( 'password_protected_theme_file', 'my_password_protected_theme_file' );