Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wp-user-manager/d04c87482fa7b29478a6e4ab164db745 to your computer and use it in GitHub Desktop.
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
<?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' );
@wp-user-manager
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment