Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I changed my WordPress blog URL from:

http://example.com/%year%/%monthnum%/%day%/%postname%/

into first,

http://example.com/%postname%/

and then after many days,

http://example.com/%post_id%/%postname%/

But now seen that, they are taking the author archive link to a dead end (404). Where the default author archive link is: /?author=1, with any of these permalinks, the author archive's link becomes /author/1. But the URL is taking me to a 404. I've tested in my local dev environment too, can't get what's the exact URL which can give me the author archive.

The author archive link, that's in my theme is:

<a href="<?php echo get_author_posts_url( false, $authordata->ID, $authordata->user_nicename ); ?>">
   <?php the_author(); ?>
</a>

Is that a bug of WordPress or I'm doing something wrong?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Your get_author_posts_url() seems wrong, it doesn't accept three parameters. Passing ID as first one should be sufficient to generate correct link, name argument is pretty redundant there.

share|improve this answer
    
Thanks @rarst. Just changed function to <?php echo get_author_posts_url( $authordata->ID, $authordata->user_nicename ); ?> and yala. Removed the false, part. SOLVED! :) –  Mayeenul Islam Apr 9 at 7:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.