Forums

[resolved] I need to have the authors name displayed for each post (4 posts)

  1. aten
    Member
    Posted 3 years ago #

    http://img117.imageshack.us/img117/235/inkedpapercommw6.png

    where it says " This entry was posted on Dec 24 2008 "

    I would like it to say "This entry was posted on Dec 24 2008 by AUTHOR"

    <?php get_header(); ?>
    
    <div id="content">
    
    <div class="entry">
    
    		<?php $my_query = new WP_Query('showposts=1');
            while ($my_query->have_posts()) : $my_query->the_post();
            $do_not_duplicate = $post->ID; ?>
    
            <div class="post new" id="post-<?php the_ID(); ?>">
    
            <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
            <div class="info"><div class=""><?php comments_popup_link('', '', ''); ?>  This entry was posted on <?php the_time('M d Y'); ?> <?php edit_post_link('Edit', ' | ', ''); ?>  </div></div>
    
            <?php the_content('Read more &raquo;'); ?>
    
            <div class="meta">
            <div class="tags"><?php the_tags('', ', ', '<br />'); ?></div>
            <div class="cats"><?php the_category(', ') ?></div>
            </div><!--meta-->
    
            </div><!--post-->
            <?php endwhile; ?>
    
            <?php if (have_posts()) : while (have_posts()) : the_post();
            if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?>
    
            <div class="post" id="post-<?php the_ID(); ?>">
    
            <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
            <div class="info"><div class="comments"><?php comments_popup_link('', '', ''); ?>  This entry was posted on <?php the_time('M d Y'); ?> <?php edit_post_link('Edit', ' | ', ''); ?>  </div></div>
    
            <?php the_content('Read more &raquo;'); ?>
    
            <div class="meta">
            <div class="tags"><?php the_tags('', ', ', '<br />'); ?></div>
            <div class="cats"><?php the_category(', ') ?></div>
            </div><!--meta-->
    
            </div><!--post-->
    		<?php endwhile; ?>
    
            <div class="alignleft"><?php next_posts_link('Older Entries') ?></div>
            <div class="alignright"><?php previous_posts_link('Newer Entries') ?></div>
            <br clear="all" />
    
    		<?php else : ?>
    		<?php endif; ?> 
    
    </div><!-- end of entry -->
    </div><!--content-->
    
    <?php get_footer(); ?>

    Thanks a bunch,
    Aten

  2. Change
    This entry was posted on <?php the_time('M d Y'); ?>

    to
    This entry was posted on <?php the_time('M d Y'); ?> by <?php the_author(); ?>.

    Easy :) If you want to have it link to the author's profile page (and list everything they've posted) use the_author_posts_link() instead.

  3. aten
    Member
    Posted 3 years ago #

    sweet
    thanks a bunch!

  4. aten
    Member
    Posted 3 years ago #

    I knew it was easy just didnt know what to put where

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags