Add Author to Post information in the Loop

Latest Reply from LateNights at 2013-07-05 23:45:06
I've been trying to figure out how to add "Author" as part of a typical blog post's description in the RetroPress Theme. In theloop.php, I've even tried aping the 'category' heading, but nothing appears when I add it in. Here is the relevant code:

global $post, $query_string, $SMTheme;
if (have_posts()) :

if (!isset($_GET['ajaxpage'])) {?>
<div class='articles'>
<?php }
while (have_posts()) : the_post();
<div class='one-post'>
<div id="post-<?php the_ID(); ?>" <?php post_class("post-caption"); ?>>
<?php if (!is_single()&&!is_page()) { ?>
<h2><a href="<?php the_permalink(); ?>" title="<?php printf( $SMTheme->_( 'permalink' ), the_title_attribute( 'echo=0' ) ); ?>" class='post_ttl'><?php the_title(); ?></a></h2>
<?php } else { ?>
<h1><?php the_title(); ?></h1>
<?php } ?>
<p><?php if (!is_page()) {?><span class='post-date'><span class='day'><?php echo get_the_date('d'); ?></span><br /><span class='month'><?php echo get_the_date('M'); ?></span></span>

<!-- Author Info -->
<img alt="" src="<?php echo get_template_directory_uri();
?>/images/smt/category.png">Author:&nbsp;<?php the_author(',&nbsp;'); }?>

<img alt="" src="<?php echo get_template_directory_uri();
?>/images/smt/category.png">Category:&nbsp;<?php the_category(',&nbsp;'); }?>
<?php if(comments_open( get_the_ID() )) {
?><img alt="" src="<?php echo get_template_directory_uri(); ?>/images/smt/comments.png">Comments:&nbsp;<span class="meta_comments"><?php comments_popup_link( $SMTheme->_( 'noresponses' ), $SMTheme->_( 'oneresponse' ), $SMTheme->_( 'multiresponse' ) ); ?></span>

Leave a reply

Add codeAdd image