Conventionally the post-meta (date, author, categories, etc) is placed above or below the post content. Instead I want to place it somewhere within the content by using a plugin that implements a shortcode.
The business end of the plugin looks like this:
add_shortcode("my-post-meta", "mypostmeta_handler");
function mypostmeta_handler() {
global $post;
$postmeta_output = '<div class="post-meta">';
$postmeta_output .= 'Posted on ' . the_time('j F Y');
$postmeta_output .= 'by ' . the_author_posts_link();
$postmeta_output .= 'in ' . the_category(', ');
$postmeta_output .= '</div>';
return $postmeta_output;
}
In the browser I was expecting: Posted on 13 December 2011 by admin in Work, News. Instead, the constant strings appear in the browser in the correct position as a single, concatenated string: Posted on by in. But the post meta somehow detached itself from the div and displayed at the beginning of the content, also as a concatenated string: 13 December 2011adminWork, News
What do I need to do to control it?