I am using a custom post type and I need to add the Post Title to my template. I know that you can hard code that into a template but I prefer to use a shortcode like this:
function post_title_shortcode(){
return get_the_title();
}
add_shortcode('post_title','post_title_shortcode');
Just asking in case there is a “preferred” way?
Much the same way that GP has a copyright date shortcode right? Is there something similar for the Post Title?
I don’t want to duplicate efforts, hence the question, thanks.