WordPress.org

Ready to get started?Download WordPress

Forums

Author Link Going to Home Page Instead of Author Page (2 posts)

  1. indextree
    Member
    Posted 5 years ago #

    On my site we have multiple authors. I followed the directions that I found here on how to set this up but something is wrong. When you hover over each link it says http://www.sitename.com/blog/author/authorname/ but when you click on it you go to the home page.

    I was able to set it up so under each post (except on home page) it displays the Author's Name and that would link to an author profile page with:

    <p>Written by <?php the_author_posts_link(); ?> | <?php the_time('F j, Y'); ?> </p>

    Then I created an author.php file:

    <?php get_header(); ?>
    
    <div id="content">
    
       <div id="contentleft">
    
    <!-- This sets the $curauth variable -->
    <?php
    if(isset($_GET['author_name'])) :
    $curauth = get_userdatabylogin($author_name);
    else :
    $curauth = get_userdata(intval($author));
    endif;
    ?>
    <h3>About: <?php echo $curauth->display_name; ?></h3>
    <p><strong>Website:</strong> <a href=”<?php echo $curauth->user_url; ?>”><?php echo $curauth->user_url; ?></a></p>
    <p><strong>Profile:</strong> <?php echo $curauth->user_description; ?></p>
    <h3>Posts by <?php echo $curauth->display_name; ?>:</h3>
    <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>
    </li>
    <?php endwhile; else: ?>
    <p><?php _e(’No posts by this author.’); ?></p>
    <?php endif; ?>
    <!– End Loop –>
    </ul>
    </div>
    
    <?php include(TEMPLATEPATH."/sidebar_right.php");?>
    
    </div>
    
    <!-- The main column ends  -->
    
    <?php get_footer(); ?>

    What am I missing?

  2. powtac
    Member
    Posted 5 years ago #

    Hi indextree,
    I created a plugin which prevents the 404 at the authors page when no posts where written by this author, perhaps it fits your problem?

    http://wordpress.org/extend/plugins/show-authors-without-posts/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.