WordPress.org

Ready to get started?Download WordPress

Forums

Viewing author's username (6 posts)

  1. xfwayne
    Member
    Posted 7 years ago #

    How can I allow WordPress to view the author's username? I have a number of people on my site requesting for prayers and we need to know who has which prayer needs. Thank you.

  2. Samuel B
    moderator
    Posted 7 years ago #

    Very easy - this should get you going:
    http://codex.wordpress.org/Template_Tags/the_author

  3. xfwayne
    Member
    Posted 7 years ago #

    Thanks for the link. I tried inserting the code in but got an error. I wonder if I'm not turning something on because here is what the index is showing already (see the "the_author" in the middle):

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <?php// the_date('','<h2>','</h2>'); ?>

    <div class="post"> <!--div post starts-->
    <h3 class="storytitle" id="post-<?php the_ID(); ?>">" rel="bookmark"><?php the_title(); ?></h3>

    <div class="meta"><?php _e("Filed under:"); ?> <?php the_category(',') ?> — <?php// the_author() ?> <?php the_time('F j, Y @ g:i a'); ?> <?php edit_post_link(__('Edit This')); ?></div>
    <div class="storycontent">
    <?php the_content(__('(more...)')); ?>
    </div>

    <div class="feedback">
    <?php wp_link_pages(); ?>
    <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
    </div>

  4. spencerp
    Member
    Posted 7 years ago #

    Why is your code for the author like this:
    <?php// the_author() ?>

    Shouldn't it be like this:
    <?php the_author_nickname(); ?>

    Or:
    <?php the_author() ?>

    Or:
    <?php the_author(); ?>

    Not too sure about the last two there, but I use the first one on my blog now. =)

    spencerp

  5. xfwayne
    Member
    Posted 7 years ago #

    OK. Thanks, spencerp!

    I tried the suggested link but that didn't work. Neither did the first one you posted above. However, that last one worked.

    Again, thank you!

  6. spencerp
    Member
    Posted 7 years ago #

    No problem. =) Atleast *something* worked lol! =)

    spencerp

    P.S. You might want to mark/tag this as [resolved] then maybe.. so ppl know.. ya got it fixed or whatever.. =P You can always post back, if you want to though.. ;)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags