WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How do I create author pages? (7 posts)

  1. FunkyDung
    Member
    Posted 8 years ago #

    Before anyone asks, yes, I read the relevant forum threads on author templates, etc. I'm still clueless.

    I have a call to list_authors in my sidebar. When I click on one of the authors, I get a 404 error.

    I'm using WordPRess 2.0. I have an author.php template file. My permalink structure is /archive/%post_id%. The author pages should be found at archive/%author%, but they aren't.

    My main page is here:

    http://alesrarus.funkydung.com

    One of the author pages I'd like to create:

    http://alesrarus.funkydung.com/archive/author/funky-dung/

    The author.php file I'm trying to use:

    <?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->nickname; ?>:</h2>

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

    <li>
    <a>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>">
    <?php the_title(); ?></a>,

    <?php the_time('d M Y'); ?> in <?php the_category('&');?>

    <?php endwhile; else: ?>
    <?php _e('No posts by this author.'); ?>

    <?php endif; ?>
    <!-- End Loop -->

    </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
    `

  2. MichaelH
    Member
    Posted 8 years ago #

    Maybe it is here:
    Author_Templates#Custom_Author_Template

    in particular this:
    2.0 bug requires
    get_userdatabylogin(get_the_author_login()));

  3. FunkyDung
    Member
    Posted 8 years ago #

    That change had no effect.

    Is there some step that I have missed? Is there a step-by-step tutorial somewhere on how to set up author pages? I didn't see one in the codex or the forums (at least not one I could comprehend in my WP newbiness).

  4. MichaelH
    Member
    Posted 8 years ago #

    I'm not experiencing your problem on 2.0 or 2.1 on a localhost xampp system nor on a linux host at 2.1.

    I used your exact code (more about that later) and your Permalink settings.

    Here's what I did:
    I put a wp_list_authors() tag in my themes/default/sidebar.php file. Then created a themes/default/author.php file with your code. Clicked on an author's nickname in my sidebar and got a http://www.sample.com/archives/author/username type url in my browser with their posts displayed.

    Take a look at this for a better display of your author's posts Author_Templates#Listing_Entries_via_The_Loop.

    Not too sure what to tell you. Maybe start with an empty .htaccess file and Update Your Permalink Structure.

  5. FunkyDung
    Member
    Posted 8 years ago #

    Is there any significance to the choice of wp_list_authors() over 'list_authors()?

    I wondered if maybe by .htaccess file was screwed up. Hopefully I wouldn't be beaten with a LART (aka Clue Bat or Clue by 4) if I said that setting that file up properly is opaque to me. ;) Here's my .htaccess:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    # Redirect FeedBurner to your own Feed
    RewriteBase /
    RewriteRule ^feedburner_733196/?$ /feed/ [R,L]
    RewriteCond %{HTTP_USER_AGENT} ^FeedBurner.*$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # These Rules redirect all feed Traffic to FeedBurner
    RewriteBase /
    RewriteCond %{QUERY_STRING} ^feed=(feed|rdf|rss|rss2|atom)$
    RewriteRule ^(.*)$ http://feeds.feedburner.com/AlesRarus [R,L]
    RewriteRule ^(feed|rdf|rss|rss2|atom)/?(feed|rdf|rss|rss2|atom)?/?$ http://feeds.feedburner.com/AlesRarus [R,L]
    RewriteRule ^wp-(feed|rdf|rss|rss2|atom).php http://feeds.feedburner.com/AlesRarus [R,L]
    # These are the standard WordPress Rules
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php
    </IfModule>

    # END WordPress'

    Do I need to add/modify anything?

    BTW, thanks for the help so far. It's nice to find a forum in which a newbie isn't dismissed as a pest. ;)

  6. MichaelH
    Member
    Posted 8 years ago #

    wp_list_authors() could be described as a wrapper to list_authors. The difference is that one passes all the parameters as one string and the other passes each parameter separated by commas.

    Can't address your .htaccess I was just suggesting start with an empty .htaccess, let WordPress generate a new set of rules then try that. I'm LART also. ;)

  7. FunkyDung
    Member
    Posted 8 years ago #

    I've discovered that my archives and category pages give me 404 errors as well. I guess it's time to figure out how htaccess works...

Topic Closed

This topic has been closed to new replies.

About this Topic