Shortcode is not displaying content
We have a shortcode in our functions and we are able to select the shortcode from the Admin Columns options but it does not print anything. The shortcode we are trying to print is below.
Any idea as to why it’s not displaying the author email address?
Even when we modify the shortcodeo output a hardcoded string, nothing displays.
function author_email_shortcode()
{
ob_start();
// We get the author ID outside loop.
global $post;
$author_id = $post->post_author;
// Now get the author ID inside loop.
$author_id = get_the_author_meta(‘ID’);
$output = get_the_author_meta(‘user_email’, $author_id);
ob_end_clean();
return $output;
}
add_shortcode(‘author_email’, ‘author_email_shortcode’);
We have confirmed when using the shortcode “<?php echo do_shortcode( ‘[author_email]’ );?>” does print the users email but nothing displays when we select the shortcode for the column.
Any idea what we are missing in this shortcode to have it print the persons email address?
You must be logged in to reply to this topic.