Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Add this to your functions.php or functionality plugin
function my_single_template_by_post_id( $located_template ) {
return locate_template( array( sprintf( "single-%d.php", absint( get_the_ID() ) ), $located_template ) );
add_filter( 'single_template', 'my_single_template_by_post_id' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment