Last active
December 19, 2015 22:39
-
-
Save cheh/6029153 to your computer and use it in GitHub Desktop.
WP: Using get_template_part within Shortcodes
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 my_ads_shortcode( $attr ) { | |
ob_start(); | |
get_template_part( 'ads' ); | |
return ob_get_clean(); | |
} | |
add_shortcode( 'ads', 'my_ads_shortcode' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment