Author page wordpress plugin

This plugin shows a specific page for each author, showing the number of posts published and some of the data entered in the Wordpress admin section, i.e. URL, AIM ICQ number, etc... except email! But it can provide a contact form that will send an email to the author's address.

You can use it as an 'About' page for a personnal weblog or to give each author their own page in a collaborative blog.

To install it, download the source code and save it in a php file or get the gzip file and unpack it.

Upload the resulting file to your wp-content/plugins directory and activate it from the admin interface.

To use it put the author() function in you index.php template, where it normally shows the message that there are no posts.

In the default template, it looks like this:

 <?php endforeach; else: ?>
 <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
 <?php endif; ?>

Replace this by :

 <?php endforeach; else: ?>
 <?php author(true, 5); ?>
 <?php endif; ?>

The first optionnal boolean parameter gives you the opportunity to show or hide a contact form for the author. Defaults to 'true' (show the form).

In version 0.2+, the second parameter is an integer an defines the number of latest posts to show. The default is '0'. You may want to change some of the text in the plugin file to your own language.

To do a link to the author page, you have to do something like this:

 <a href="index.php?author_name=<?php the_author_login(); ?>">
 <?php the_author(); ?></a>

if you do not wish to or can't use rewrite rules.

On this site, I use the following rewrite rule:

 RewriteRule ^about/? /index.php?author_name=jonathan [QSA]

With a link to the 'About' page simply like this :

 <a href="/about/">About</a>

On a multiuser blog, you could do this:

RewriteRule ^author/?(.*)/? /index.php?author_name=$1 [QSA]

and so the link to the page is like this:

 <a href="/author/<?php the_author_login(); ?>
 <?php the_author(); ?></a>

Version 0.3+ use native Wordpress functions to display the author data, making it more compatible (I hope) with future versions of Wordpress.

En Français


30 comments about 'Author page wordpress plugin'

Get the comments feed for this entry or post a trackback from your own blog

  1. Gravatar
    Stephan said:
    3 years, 8 months ago,

    Hi! I just tried your Plugin, but it says Call to undefined function: lp() in .../author.php on line 130

    Should I have that function, or what is missing?

  2. Gravatar
    Jonathan said:
    3 years, 8 months ago,

    No, sorry, it was my fault because I just installed the language_picker plugin and modified the author plugin to use it. Download it again now and you should be all right.

  3. 3 years, 8 months ago,

    I have 2 things.. First you have an error on " <?php endforeach; else: ?> <?php author(true, 5); ?&gt; <?php endif; ?>" it should be " <?php endforeach; else: ?> <?php author(true, 5); ?> <?php endif; ?>" cuz when i changed it it didnt work (messed up my site) about an hour of lookin later i figured it out (basic php! lol)

    2

    I can not get the multi user blog working.. How will i do that i am confused wit ur instructions .. sry

  4. 3 years, 8 months ago,

    ok, i have it partially set up... i have it to where you go to /author/admin or sk8er_boy111200 so i my mod rewrite i have

    RewriteRule ^author/?(.*)/? /index.php?author_name=$1 [QSA] RewriteRule ^author/?(.*)/? /index.php?author_name=$6 [QSA] but then i wanna put a link to the 2 others i tried but i dont get how the link works...?

  5. Gravatar
    Jonathan said:
    3 years, 8 months ago,

    No, in your .htacces, you only need this one line:

     RewriteRule ^author/?(.)/? /index.php?author_name=$1 [QSA]
    

    and then the link to the author page is author/admin or author/sk8er_boy111200 or author/mylogin, where mylogin is your login name (the one you type to enter the admin interface). You can get it with the

     the_author_login()
    

    template tag.

  6. Gravatar
    Stephan said:
    3 years, 8 months ago,

    Very nice! Now it works!

  7. Gravatar
    Oleg said:
    3 years, 8 months ago,

    When I use this plugin (I followed everything) and bring up the page with the author profile (/index.php?author_name=Oleg) I just get a huge page with all plog entries posted ever.

    What am I doing wrong?

  8. Gravatar
    Jonathan said:
    3 years, 8 months ago,

    Is 'Oleg" your actual login? Capitalization is important as well.

  9. Gravatar
    Oleg said:
    3 years, 8 months ago,

    SOlved the problem. It was that you cannot have your login name as your post name or something. I just use anything but "Oleg" (even tried non caps) and it works fine. Weird bug.

    Thanks.

  10. Gravatar
    zuppah said:
    3 years, 8 months ago,

    if I click on /index.php?author_name=admin the plugin works fine. if I click on other authors names I receive back their posts. I tried to change post names with other different form the login one (as oleg seems to soggest), but it doesn't work :(

  11. Gravatar
    Jonathan said:
    3 years, 8 months ago,

    Hi, Could you give me the names of your other authors? I could only see your name on the posts I viewed.

  12. Gravatar
    zuppah said:
    3 years, 8 months ago,

    http://www.zuppah.it/index.php?author_name=luca this is the second autor! (I created other identities but I have to update my database to import old posts)

  13. Gravatar
    zuppah said:
    3 years, 8 months ago,

    hi! I see you tested an alternative link for the second author. I'm using that to generate the page by a direct link. thanks for the idea ;), even if I can't use it in the loop, I can create the author pages!

  14. 3 years, 8 months ago,

    [...] contact with the author of the post. Get the plugin with all installation instructions at the author page plugin page Contact Author | Print This Article Related Articles [...]

  15. The iWorld said:
    3 years, 8 months ago,

    Author Page Plugin for Wordpress A cool developement for wordpress! Now you can also offer an author's page to each of your blog authors. This authors page reports total number of posts made by each author. This also provides some of the data provided by the author in his/her profile...

  16. Gravatar
    niss said:
    3 years, 7 months ago,

    I keep trying to install this plugin, but whenever i edit the

     <?php endforeach; else: ?>
     <?php author(true, 5); ?>
     <?php endif; ?></div>
    

    section in my index, i get the following error upon loading the page.

     Parse error: parse error, unexpected T_ENDFOREACH in /home/nississi/public_html/wp/index.php on line 71
    

    ack?

  17. Gravatar
    said:
    3 years, 6 months ago,

    Hi, Are you sure you deleted the endforeach that was already there? Did you do any other mods to the default template?

  18. 3 years, 6 months ago,

    [...] ??????????????????????????????? Authorpage - ????? ???????? ?????????? [...]

  19. 3 years, 4 months ago,

    hi,

    very nice plug, but I have a lot of problems with other function. for example my PDF plug says

    Warning: Cannot modify header information - headers already sent by (output started at /homepages/27/d108829608/htdocs/beta/wp-content/plugins/autor.php:248) in /homepages/27/d108829608/htdocs/beta/wp2pdf/wp2pdf.php on line 389

    there are also problem in the admin area (change templates) etc.

  20. Gravatar
    Jonathan said:
    3 years, 4 months ago,

    Hi, It's because you have a space either at the end or at the beginning of the author plugin file. Remove it and everything should be all right.

  21. Gravatar
    luckyLuke said:
    3 years, 4 months ago,

    uuupps - thanks! it works fine, but now I guess , I have the same problem as zuppah :)) - It only displays a page for the admin. On sites of the other authors are just their articles....

    PS: your software told me, I have a bad karma - well I know... Bu how ever: this is the third time I try to send a message.

  22. Gravatar
    Jonathan said:
    3 years, 4 months ago,

    Yeah, pretty bad karma it seems... It was sent in moderation for whatever reason...

    Weird problem, I don't have a clue what could be causing it. It's true that this plugin is quite messy though.

  23. Gravatar
    Eric said:
    3 years, 3 months ago,

    Using Wordpress 1.5. Getting error:

     Parse error: parse error, unexpected T_ENDFOREACH in
     /home/axic/public_html/tutorialz/wp-content/themes/classic/index.php on line 31
    

    No clue why, gone over everything a million times. Thanks in advance.

  24. Gravatar
    Jonathan said:
    3 years, 3 months ago,

    Eric, I guess it's because they changed the 'foreach' in 'while' in the code given in the post, replace 'endforeach' by 'endwhile and you should be all right.

  25. 3 years, 3 months ago,

    I've got it working kind of, It will show the posts for mulitple authors but I can't get a profile page... am I doing something obviously wrong?

  26. Gravatar
    Jonathan said:
    3 years, 3 months ago,

    Christopher,

    I don't know if you're doing anything wrong... Which version of wordpress are you using?

  27. Gravatar
    roland said:
    3 years, 3 months ago,

    Same problem as Christopher. I use 1.5 (Maybe it is because of the same url-adresses index.php?author_name=Authorname ->it is normally for the author archives? )

  28. Gravatar
    Jonathan said:
    3 years, 3 months ago,

    Christopher and roland,

    Yes the problem is that this plugin was designed for WP 1.2, and I'm not surprised it doesn't work with 1.5.

    You can try one thing, though, and that is change all the $author_name variables to $author_page or whatever in the plugin file and in the .htaccess (if you have one). I don't guarantee anything, but it's worth giving it a try.

  29. 3 years, 1 month ago,

    Hi, great script, great idea... but has anybody still solved the problem, that only the admin-profil is shown? On the pages of the other authors the script only displays a list of their articles...

    PS: I still use WP 1.2.2 (too much trouble with updateing my over-customized system ;-)))

  30. Gravatar
    Daniela said:
    2 years, 12 months ago,

    Won't show authors page and I don't know why!