Created
September 6, 2021 18:05
-
-
Save addisonhall/26e2775ebdf756ca367bf3f20c2ae524 to your computer and use it in GitHub Desktop.
Simple Wordpress shortcode to output current post title
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
/** | |
* Output the post title. | |
* [gpc_post_title] | |
*/ | |
add_shortcode( 'gpc_post_title', 'gpc_post_title_func' ); | |
function gpc_post_title_func() { | |
return get_the_title(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment