Created
April 24, 2012 15:22
-
-
Save mattboon/2480565 to your computer and use it in GitHub Desktop.
WordPress - Call an external template via shortcode
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 shortcode_your_shortcode() { | |
ob_start(); | |
include (TEMPLATEPATH . '/inc/your-template.php'); | |
$output_string = ob_get_contents(); | |
ob_end_clean(); | |
return $output_string; | |
} | |
add_shortcode('SHORTCODE', 'shortcode_your_shortcode'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment