If remembering well, I derived this technique from here: Use template_include with custom post types.
We use a plugin that will generate a "Virtual Template" for a given Post Type. The filter template_include will render a template file that resides in the plugin folder.
You have to refine the function custom_template and the template file to suit your needs. Hope this helps ;)
Plugin File
adjust the post_type name in the class instantiation
<?php
! defined( 'ABSPATH' ) AND exit;
/*
Plugin Name: Virtual Template for CPT
Plugin URI: http://wordpress.stackexchange.com/q/75307/12615
Description: Use the plugin's template file to render an outsider loop.
Author: brasofilo
Author URI: http://wordpress.stackexchange.com/users/12615/brasofilo
Version: 2012.12.11
License: GPLv2
*/
$virtual_template = new VirtualTemplateForCPT_class( 'movies' );
class VirtualTemplateForCPT_class
{
private $pt;
private $url;
private $path;
/**
* Construct
*
* @return void
**/
public function __construct( $pt )
{
$this->pt = $pt;
$this->url = plugins_url( '', __FILE__ );
$this->path = plugin_dir_path( __FILE__ );
add_action( 'init', array( $this, 'init_all' ) );
}
/**
* Dispatch general hooks
*
* @return void
**/
public function init_all()
{
add_action( 'wp_enqueue_scripts', array( $this, 'frontend_enqueue' ) );
add_filter( 'body_class', array( $this, 'add_body_class' ) );
add_filter( 'template_include', array( $this, 'custom_template' ) );
}
/**
* Use for custom frontend enqueues of scripts and styles
* http://codex.wordpress.org/Plugin_API/Action_Reference/wp_enqueue_scripts
*
* @return void
**/
public function frontend_enqueue()
{
global $post;
if( $this->pt != get_post_type( $post->ID ) )
return;
}
/**
* Add custom class to body tag
* http://codex.wordpress.org/Function_Reference/body_class
*
* @param array $classes
* @return array
**/
public function add_body_class( $classes )
{
global $post;
if( $this->pt != get_post_type( $post->ID ) )
return $classes;
$classes[] = $this->pt . '-body-class';
return $classes;
}
/**
* Use the plugin template file to display the CPT
* http://codex.wordpress.org/Conditional_Tags
*
* @param string $template
* @return string
**/
public function custom_template( $template )
{
$post_types = array( $this->pt );
$theme = wp_get_theme();
if ( is_post_type_archive( $post_types ) )
$template = $this->path . '/single-virtual-cpt.php';
if ( is_singular( $post_types ) )
$template = $this->path . '/single-virtual-cpt.php';
return $template;
}
}
Template file
single-virtual-cpt.php
put in the same folder as the plugin file
<?php
/**
* A custom -not from the theme- template
*
* @package WordPress
* @subpackage Virtual_Template
*/
get_header();
while ( have_posts() ) : the_post(); $theID = $post->ID;
_e('This is a virtual template for the post:<br />');
the_title();
endwhile;
get_footer();
?>
</body>
</html>
Result

click to enlarge ⤴
add_action('template_redirect', 'wpse_75558_template_redirect')to call directly before headers are sent for the output of the rendered template or if you want to control the_content() output you can useadd_filter( 'the_content', 'wpse_75558_the_content' )try this WP action reference – nackle Dec 10 '12 at 19:28the_content. The reason atemplate_redirectwon't work is because I'd like to keep all of the HTML of the theme the same, only replacing the content within the loop - if that makes any sense! – Andy Adams Dec 10 '12 at 22:40