Created
May 31, 2014 16:42
-
-
Save fomigo/ee7e8f97ad7ef5f8acd3 to your computer and use it in GitHub Desktop.
wp: single-{id}.php
This file contains 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_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