Skip to content

Instantly share code, notes, and snippets.

View barmolino's full-sized avatar

Dimitar Krumov barmolino

View GitHub Profile
@maor
maor / single-id-template.php
Created December 1, 2012 20:22
Add this to your functions.php or functionality plugin
<?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' );