Skip to content

Instantly share code, notes, and snippets.

@kjohnson
Last active October 22, 2015 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kjohnson/a09ec4c87048d5dbd747 to your computer and use it in GitHub Desktop.
Save kjohnson/a09ec4c87048d5dbd747 to your computer and use it in GitHub Desktop.
The Invisible Preview Page - Filters
<?php
add_filter('template_include', 'my_preview_content' );
function my_preview_content(){
return "My Preview Content Here";
}
add_filter('template_include', 'my_preview_template' );
function my_preview_template(){
return locate_template( array( 'page.php', 'single.php', 'index.php' ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment