Created
October 9, 2012 16:37
-
-
Save KyleNumann/3859931 to your computer and use it in GitHub Desktop.
Shortcode to include php file
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
function featured_project_short(){ | |
ob_start(); | |
//include the specified file | |
include(TEMPLATEPATH.'/inc/featured_project.php'); | |
//assign the file output to $content variable and clean buffer | |
$content = ob_get_clean(); | |
//return the $content | |
//return is important for the output to appear at the correct position | |
//in the content | |
return $content; | |
} | |
//register the Shortcode handler | |
add_shortcode('featured_project', 'featured_project_short'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment