diff --git a/inc/widget-custom-post-type-recent-posts.php b/inc/widget-custom-post-type-recent-posts.php index 207e791..8901453 100644 --- a/inc/widget-custom-post-type-recent-posts.php +++ b/inc/widget-custom-post-type-recent-posts.php @@ -37,6 +37,18 @@ public function widget( $args, $instance ) { 'ignore_sticky_posts' => true, ) ) ); + $possible_templates = array( + 'content-'.$this->alt_option_name.'-'.$posttype.'.php', + 'content-'.$this->alt_option_name.'.php' + ); + $template_found = false; + + foreach( $possible_templates as $a_possible_template ){ + if( locate_template( $a_possible_template ) ){ + $template_found = locate_template( $a_possible_template ); + } + } + if ( $r->have_posts() ) : ?>