Created
October 25, 2019 13:18
-
-
Save wp-user-manager/d04c87482fa7b29478a6e4ab164db745 to your computer and use it in GitHub Desktop.
WP User Manager - Allow admins to select the custom template for the user directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_wpum_get_directory_user_templates( $directories ) { | |
$directories['custom'] = 'Custom User Template'; | |
return $directories; | |
} | |
add_filter( 'wpum_get_directory_user_templates', 'my_wpum_get_directory_user_templates' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You would need to add a user single template to your theme for this, with the name
single-{slug}.php
, where the slug is the same as the array key you added in the code. eg.wp-content/themes/mytheme/wpum/directory/single-custom.php