• Hey – I’m new to wordpress, naturally, and have searched high & low for a way to display a “current author” on an authors’ archive page.

    I understand how to get an author name displayed within the loop, but cannot find anything for displaying an author name outside of the loop (author name at top of page). There’s got to be a simple way that I’m merely overlooking.

    The closest I can come is by using the get-author-profile plugin: http://guff.szub.net/2005/01/31/get-author-profile/

    But it seems as though this should be doable without a plugin. Thanks.

Viewing 15 replies - 46 through 60 (of 66 total)
  • With regard to the DaveQ/Kathy P/Beel discussion earlier, it does seem like there is a problem with the author.php page’s function when an author’s user name and nickname are not the same. Instead of using the code suggested in the codex (http://codex.wordpress.org/Author_Templates), I used the example from http://centripetalforces.com/2005/04/30/under-the-wp-bonnet-2/, which is referenced in another thread. This lets you work within the loop in your author.php page to show the author’s information once, with posts listed after.

    Do these methods work in WP 2.0? I can’t get them to. I posted here:

    http://wordpress.org/support/topic/51137

    But haven’t gotten any responses. None of the methods to access the author information outside of the loop seem to be working in 2.0.

    Well, through about 8 hours of trial and error, I thought I almost was close to getting my author template to work right…then suddenly I get nothing but a blank screen.
    My site is http://www.fcaoneyearbible.com

    Here is the code I am using on the author.php page:

    ——begin code——–
    <?php
    if(get_query_var(‘author_name’)) :
    $curauth = get_userdatabylogin(get_query_var(‘author_name’));
    else :
    $curauth = get_userdata(get_query_var(‘author’));
    endif;
    ?>
    <?php get_header();?>

    <div id=”main”>

    <div id=”content”>

    <h2>About <?php echo $curauth->display_name;?></h3>

      <?php echo $curauth->description; ?>

    <h3>Contact Information for <?php echo $curauth->first_name;?>:</h3>
    user_email;> ?”>Contact this author
    AIM Screenname – <?php echo $curauth->aim;?>
    MSN Screenname – <?php echo $curauth->msn;?>
    Yahoo Screenname – <?php echo $curauth->yim;?>
    user_url; ?>”>Go to <?php echo $curauth->first_name;?>’s personal web site
    <h3>Posts by <?php echo $curauth->nickname; ?>:</h3>

      <?php wp_list_authors(); ?>

    ——-end of code——

    Any help would be SO APPRECIATED!

    Also, my “mailto” doesn’t work correctly (or at least it didn’t last time I could preview the page)

    I don’t know what the problem actually was, but I just deleted the author.php and started over … somehow managing to get something that resembles what I’m trying to do.

    sarahd, that link to http://centripetalforces.com/2005/04/30/under-the-wp-bonnet-2/ is not working, and your comment was the closest I’ve come to finding an answer! Can you tell me how you worked around it when the name and nickname are not the same.

    On my author.php page I am able to get a list of posts, but cannot get author info to show up, even though it is in their profile.

    I’ve checked the codex and none of the methods are working.

    Here is the code I’m using if anyone wants to take a peak at it and offer some suggestions.

    Thanks,
    Kathy


    <?php get_header(); ?>
    <?php get_sidebar(); ?>

    <div class=”main-copy”> <!– note that main-copy is closed in the footer.php –>
    <div id=”content” class=”narrowcolumn”>

    <!– This sets the $curauth variable –>
    <?php
    if(isset($_GET[‘author_name’])) :
    $curauth = get_userdatabylogin($author_name);
    else :
    $curauth = get_userdata(intval($author));
    endif;
    ?>

    <h2>About: <?php echo $curauth->nickname; ?></h2>
    <dl>
    <dt>Website</dt>
    <dd>user_url; ?>”><?php echo $curauth->user_url; ?></dd>
    <dt>Profile</dt>
    <dd><?php echo $curauth->description; ?></dd>
    </dl>

    </div>

    I would like to provide author information on the actual post page. I would need the name and the profile information. My PHP skills are somewhat limited but im sure getting this information into the actual post (single.php) would be easy for someone with more skills. Could someone please let me know the code I need?

    kappaluppa – I actually ended up with more problems on my author pages. I’m now using the same code as you to set the $curauth variable. If an author’s username and nickname aren’t the same, any author information called before the loop doesn’t get displayed, so I’ve put the loop before the author’s profile, etc. The only thing missing is the author’s name above the posts, which is a shame. You can check out my author directory if it is any help—currently, for example, the author “Eassumâ€? has a username/nickname issue, but “aleximouâ€? doesn’t. The best solution may just be to make sure the username and nickname match.

    This entire author page thing seems like a big hunk of junk. I’ll just make static pages and wehn WP 9.5 comes out maybe it will be fixed then – ah, who am I kidding?

    sarad…
    I looked at your author page and the page with the individual author info is what I am looking for. Can you share the code for that page?
    thanks,
    Kathy

    the relevant code is…


    <?php
    if(isset($_GET['author_name'])) :
    $curauth = get_userdatabylogin($author_name);
    else :
    $curauth = get_userdata(intval($author));
    endif;
    ?> <!-- This sets the $curauth variable -->

    <div class="storytitle"><?php echo $curauth->user_nickname; ?></div>
    <div class="blackheader">Author's Stories</div>
    <div class="text">

    <ul>
    <!-- The Loop -->
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

    <a>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>">
    <?php the_title(); ?></a>,
    <?php the_time('M d, Y'); ?> under <?php the_category('&');?>

    <?php endwhile; else: ?>
    <p class="text"><?php _e('No stories by this author yet.'); ?>

    <?php endif; ?>
    <!-- End Loop -->
    </ul>
    </div>
    <div class="blackheader">Author's Description</div>
    <div class="text">
    <?php echo the_author_description(); ?>
    </div>
    <div class="vertspacer">�</div>
    <div class="blackheader">Author's Website</div>
    <div class="text"><a>"><?php echo the_author_url(); ?></a></div>

    unbeliever

    (@unbeliever)

    Hey folks.

    I’m curious about getting a chronological list of the authors post on my authors page. This morning was my 101 crash course in PhP as I tried to puzzle out what I saw both in these forums and the documentation, but I’m still lost.

    After butchering Kafkaesqui’s code with a sledge hammer I am only able to arrive at the following…

    http://www.mmodig.com/?page_id=267

    The post list under the various authors names doesn’t reflect what they wrote at all, I was wondering what code I would need to insert to simple list their articles by date in chronological order.

    Ta in advance.

    Kafkaesqui

    (@kafkaesqui)

    unbeliever, see the info on query_posts():

    http://codex.wordpress.org/Template_Tags/query_posts

    You can use that to initialize each author’s post loop with a combination of the ‘author’ (or ‘author_name’) and ‘showposts’ parameters.

    unbeliever

    (@unbeliever)

    ta!

    thanx for your discussion, it has helped me a lot. Now, I want to include some portraits of my authors in my author’s page. Does anyone have an idea? thanx!

    OK, I have a custom category template that I link to by passing the category and the author id

    a href=”/category/crew?author=51″

    and I can get posts to show up. But what I also want to do is to dynamically get the author’s profile information (profile, first name, last name, etc) and display it outside of the loop.

    How can I do that? I’ve looked at ALL the various links (all day long) and nothing quite comes to what I want, which is to be able to display both profile and posts for a specific author by passing the author_ID via a link. It seems like most of what I have read relates to the current user or finds the current author by login…

Viewing 15 replies - 46 through 60 (of 66 total)
  • The topic ‘Current Author’ is closed to new replies.