WordPress.org

Forums

Author Name Not Showing on author.php (6 posts)

  1. equang
    Member
    Posted 9 years ago #

    Hi, I've been having this problem with my blog where the author name doesn't show up on it's respective author page. I have author.php running just fine. All the posts show up and stuff. But the author name just doesn't show up.

    I have it in the header/title thing, scripted like this: Posts by [insert name]. But the name never gets inserted. I've stuck in every bit of in loop and out of loop coding I've found on this site but nothing has worked. Any ideas of what's wrong? I would like to have the author's name at the top of their post.

    Here's the link to the blog: http://www.the-vent.net/freshair/

    You can see the list of authors on the side.

    Any help is appreciated D: I would like to get the kinks worked out of this thing ASAP.

    equang

  2. moshu
    Member
    Posted 9 years ago #

    Did you try the solutions from here:
    Author_Templates#Custom_Author_Templates_Examples ?
    There is also an author page plugin, just search for it...

  3. equang
    Member
    Posted 9 years ago #

    Yes, I've tried all of that. None of it works.

    Here's my coding for the author page:

    <?php get_header(); ?>
    <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>Posts by <?php echo $curauth->user_nickname; ?></h2>
    <ul>
    <!-- The Loop -->
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <li>
    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>">
    <?php the_title(); ?></a>,
    <?php the_time('d M Y'); ?> in <?php the_category('&');?>
    </li>
    <?php endwhile; else: ?>
    <p><?php _e('No posts by this author.'); ?></p>
    <?php endif; ?>
    <!-- End Loop -->
    </ul>
    </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Does it look all right? It's mostly copied from WordPress.

  4. moshu
    Member
    Posted 9 years ago #

    I just copied your code in the author.php on a local install and it works perfectly - showing the author's nickname (the only difference I don't use permalinks on my local WP install, but I don't think that would make a difference).

  5. equang
    Member
    Posted 9 years ago #

    Ugh, it's been weird lately. Today I made a new page and now it's stuck on like this perma-HTML weird thing where it f***s up this table and won't like submit and reset buttons show on a form.

    Yeah showing the author's name definitely doesn't work on my site. I tried it in all my browsers (Safari, Firefox, and IE) and it doesn't work in any of them.

    Maybe I should delete and then re-upload the author.php?

  6. equang
    Member
    Posted 9 years ago #

    Okay it seems to be fixed. I fooled around with the code a bit and let's hope it lasts XD

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags