Blogie Blog

I am therefore I blog

 

  •  

 

Custom WordPress author page

This how-to is important for blogs that have multiple authors, but works for single-author blogs as well. If your WordPress blog doesn’t have the author.php template, then this might just be for you. It’s a good way to promote your blog by providing your readers with juicier information about yourself (and your co-authors). This works for WordPress versions 2.5 and above.

Step #1

Upload a blank file named author.php to your theme directory [wp-content/themes/template-name/]. You must use that exact filename, otherwise, WordPress won’t recognize it. Once that’s done, you’ll see this template file appear in your Theme Editor screen inside your WordPress admin backend. Best way to make sure that the Author page comes out looking like the rest of your blog is by copying the contents of Page Template (page.php) into author.php.

Step #2

Locate The Loop, or the section of the template that controls the display of your content. The beginning of The Loop looks like this:

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

Sometimes it can look like this:

<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>

You can go ahead and delete this entire section, which ends in <?php endif; ?>. Be careful to check that you’re not deleting closing tags that do not exist inside The Loop, for example, </div> tags that were opened above the concerned section.

Make sure that the public content containers (eg., <div id="content"> or possibly <div class="post">) are still intact. Those are the elements that carry the CSS design and layout declarations of your web site. This is where you will insert the code for displaying author information.

Step #3

Copy the code below into your content container:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
	global $or_query;
	$curauth = $or_query->get_queried_object();
?>
 
<h2>About : <?php echo $curauth->nickname; ?></h2>
 
<dl>
<?php if($curauth->first_name !="" && $curauth->last_name !="") { ?>
   <dt>Full Name</dt>
      <dd><?php echo $curauth->first_name. ' ' .$curauth->last_name ?></dd>
<?php } ?>
<?php if($curauth->aim !="") { ?>
   <dt>AIM</dt>
      <dd><?php echo $curauth->aim; ?></dd>
<?php } ?>
<?php if($curauth->yim !="") { ?>
   <dt>Yahoo! Messenger</dt>
      <dd><?php echo $curauth->ym; ?></dd>
<?php } ?>
<?php if($curauth->jabber !="") { ?>
   <dt>Google Talk / Jabber</dt>
      <dd><?php echo $curauth->jabber; ?></dd>
<?php } ?>
<?php if($curauth->user_url !="" && $curauth->user_url !="http://") { ?>
   <dt>Website</dt>
      <dd><a href="<?php echo $curauth->user_url; ?>">
            <?php echo $curauth->user_url; ?></a></dd>
<?php } ?>
<?php if($curauth->description !="") { ?>
   <dt>Bio</dt>
      <dd><?php echo $curauth->description; ?></dd>
<?php } ?>
</dl>

Simply put, what the above code does is to output all the information that your blog’s authors have supplied in their profile (http://www.yourblog.com/wp-admin/profile.php). Blank fields won’t be visible, of course.

Step #4

Wouldn’t it be cool to have your photo appear on your Author page? Well, there’s something you can do about that, too! Just make sure you (and your co-authors) have an account with Gravatar.com.

Insert this piece of code just before the <dl> tag above:

1
2
3
<div style="float:right;">
<?php echo get_avatar($curauth->user_email,'60'); ?>
</div>

You can make it left-aligned or centered to suite your taste. Also, you can change the value 60 to any other number that’s either equal to or less than 80. It controls the size of the avatar.

What about a Yahoo! Messenger online status image? What the above code does is simply to display your Yahoo! ID. If you’d like to show something fancier, here’s the code to replace <dd><?php echo $curauth->ym; ?></dd> above: <dd><a href="http://edit.yahoo.com/config/send_webmesg?.target=<?php echo $curauth->yim; ?>&.src=pg"><img border="0" src="http://opi.yahoo.com/online?u=<?php echo $curauth->yim; ?>&m=g&t=1&l=us"></a></dd>

I don’t know if there’s such a thing for Google Talk, though. Anyone?

OK, on to the last part.

Step #5

This section is for showing posts by author. Insert the code below after the </dl> part in the code above.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<h2>Posts by <?php echo $curauth->nickname; ?>:</h2>
 
<ul>
<!-- The Loop -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
 
<li><?php the_time('Y-m-d'); ?> - <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></li>
 
<?php endwhile; else: ?>
 
<p><?php _e('No posts yet by this author.'); ?></p>
 
<?php endif; ?>
<!-- End Loop -->
</ul>

The date format I chose for the example will be shown like so: 2008-01-02. If you’d like another format, refer to the PHP manual for the formatting characters.

Step #6

The number of posts (the above code will spit out only the linked titles) to be displayed is controlled by WordPress settings [Dashboard > Settings > Reading]. In order to show links to older — and newer — entries, add the code below. If you have the WP PageNavi plugin installed, much better!

1
2
3
4
5
6
7
8
9
10
11
12
13
<div align="center">
<?php if(function_exists('or_pagenavi')) { ?>
   <?php or_pagenavi(); ?>
<?php } else { ?>
   <div class="alignleft">
      <?php next_posts_link('Older Entries') ?>
   </div>
   <div class="alignright">
      <?php previous_posts_link('Newer Entries') ?>
   </div>
   <br clear="all" />
<?php } ?>
</div>

You’ll notice that there are hardly any design elements in the above pieces of code. That’s up to you. Feel free to add your own positioning and other visual stuff via CSS.

Step #7

So, what’s the URL of the Author page? It’s normally http://www.yourblog.com/author/username. To make this more accessible, check your index.php, single.php, archive.php and other templates where the author’s name (or nickname) is being called. If the WP function is not the_author_posts_link(), then change it to that function so that the display name will be clickable to your brand-new Author Page.

Check out the following author pages at RP2010.com:

Blog on!! Woot!

Possibly Related Posts:
Custom WP login page  |  WordPress on your local machine  |  WordPress 2.8 rocks!  |  B.O.B. contest in honor of WordPress  |  Tracking your blog’s subscribers

10 Responses to “Custom WordPress author page”

  1. Juned 2 December 2008 at 5:10 am #

    This is really useful, Thanks.

  2. Jehzeel Laurente 2 December 2008 at 5:43 am #

    wooot! ang haba ng gagawin.. di ko masundan.. hehehe big grin

  3. bariles 2 December 2008 at 9:08 am #

    Hi blogie! This is most particularly helpful for multi-authored blogs. Thanks for the tips. :)

  4. Blogie 2 December 2008 at 12:17 pm #

    Thanks for your comments, guys! :)

  5. Nandan Jha 4 December 2008 at 12:13 am #

    Very very useful. I just put it at http://www.ghumakkar.com

    I would do the decoration part during the weekend. Great work Blogie. Best Wishes.

  6. Blogie 4 December 2008 at 11:03 am #

    @Nandan Jha — Thanks for reading my blog. :)

  7. gam3fr33k 5 December 2008 at 10:43 pm #

    Good info to know. I was thinking about upgrading my self-served wordpress blog. Now I think I won’t. Obviously it’s going to take a lot of time and I don’t have that yet. I got your post bookmarked, though!

  8. Blogie 5 December 2008 at 10:49 pm #

    @gam3fr33k — Thanks very much! I hope you’re subscribed to my feed. ;)

  9. Andy 13 March 2009 at 8:17 pm #

    A very big thanks for all the time you just saved me!

    • Blogie 13 March 2009 at 10:42 pm #

      My pleasure, Andy! Thanks for reading my blog.


Leave a Reply

Notify me of follow-up comments via email. You may also subscribe without commenting.

delivered prednisone buy prednisone tablets without rx purchase prednisone pay pal online without rx prednisone overnight where to purchase generic prednisone online without a rx cheap prednisone by money order next day prednisone delivery online pharmacy cod prednisone prednisone overnight prednisone without prescription cod prednisone without prescription shipped overnight express prednisone mastercard how to buy Paxil online without a rx how to order Paxil online without a prescription purchase Paxil online without prescription buy Paxil no visa online without prescription where can i buy Paxil without a rx Paxil free consultation fedex overnight delivery fedex Paxil overnight without a prescription buy Paxil amex online without rx Paxil without prescription overnight shipping Paxil online uk order overnight Paxil purchase Paxil without purchase online Paxil without rx Paxil fedex no prescription overnight Paxil c.o.d order Paxil online with overnight delivery order overnight prednisone canadian pharmacy accutane buy Flomax online no prescription where to buy cheap software software discounters discount software for government employees discount zone alarm software cheap pc software review tpa transfer pricing software buy masterwriter software discount bmi sesac price software development india software download shareware treo software download academic and software and discount save the cat software educational discount cheap ho9me design software discount financial software download mobile software software to stop impusive buying buy software for less keyloggers and buy and paypal not software nowbc westend order generic Orlistat game20for20imac Lasix no prescription overnight builder cheap buy xenical next day delivery xenical without a r x Maxalt usa Maxalt prices uk Valtrex generic Valtrex cash on delivery No presciption valtrex discount valtrex buying valtrex (no prescriptions needed for Buspar|buy Buspar with no prescription|online pharmacies Buspar|Buspar cheap|buy Buspar without rx|purchase rx Buspar without|Buspar purchase online|purchase Buspar online without rx|purchase Buspar free consultation|buy Buspar Online|buy Buspar american express|buy Buspar Online|buy cheap Buspar with dr. prescription|Buspar side effects|fedex Buspar without priscription|overnight Buspar without a rx|order cheap overnight Buspar|Buspar toronto|uk order Buspar|Buspar no doctors prescription|Buspar mexico|Buspar order|no prescription Buspar with fedex|order generic Buspar|buy Buspar without rx from us pharmacy|prezzo Buspar|Buspar 10mg|Buspar from canada|purchasing Buspar without a script|buy Buspar australia|purchase Buspar visa without prescription|online purchase Buspar|buy Buspar no perscription cod|buy Buspar drugs|buy Buspar with visa|buy Buspar without rx needed|buy Buspar without prescription|buy Buspar no prescription low cost|purchase purchasing Buspar without a script no prescription required Nolvadex buy cheap pharmacy Nolvadex usa windows server 2008 r2 enterprise x64 Lasix online prescription purchase cheap Flomax online 40 mg accutane buy effect Nolvadex wire transfer buy synthroid las vegas synthroid/thyroxine no prior rx low cost Nolvadex at Kentucky Avawam Buy accutane master card Lasix drug Lasix no doctors prescription buy zithromax cheap cod no rx purchase zithromax paypal without prescription Nolvadex overnight delivery fed ex Nolvadex 20 mg order Nolvadex prescription online buying Nolvadex online without rx buy Nolvadex d 20 buy 10 mg Nolvadex purchase zithromax no visa online without prescription purchase Valtrex overnight delivery order zithromax 100 mg visa buy zithromax 40mg fast delivery BUY zithromax COD purchase zithromax cod next day delivery buy 250mg zithromax mastercard buy zithromax online 500mg with mastercard cheapest finpecia available online Orlistat online order saturday delivery buy cheapest Valtrexbuy no prior prescription Valtrex buy Maxalt once a day Finpecia toronto order finpecia no visa buy herbal finpecia purchase maxalt amex online without prescription Valtrex without prescription shipped overnight express next day delivery on Buspar saturday next day delivery on Buspar saturday no perscription prednisone next day Buying prednisone online without a perscription discount valtrex purchase Crestor overnight delivery no prescripton Valtrex buy Valtrex no visa without rx free Zithromax order buy Zithromax online where can i purchase Buspar no rx buy mail order Valtrex buy online rx Arimidex without Cytotec without prescriptionwhere to buy Cytotec in brisbane buy Cytotec online india Lasix online without prescription adobe 8 install buy cheap Buspar on line Valtrex price Crestor online overnight delivery cod how to buy Prednisone without a prescription adobe acrobat ie helper adobe premiere elements 3 Proscar suppliers office 2007 student version order no prescription Crestor non rx cheap accutane 40 mg buy Tamsulosin canada Academic Software Discounts Photoshop For Sale Premiere Pro Cs4 wholesale valtrex cheap adobe web development adobe wikipedia buy Orlistat without a perscription how to buy Flomax without a prescription buy online rx Crestor without adobe reader japanese fonts Crestor on line buy Crestor on line law enforcement officers killed in 2007 buy in Orlistat uk Orlistat mexico adobe mac cs office proffesional 2007 Should I Buy Windows 7 software oem project buy Buspar with a visa buy Flomax 0.4mg blues and chili festival 2011 vancouver Microsoft 64 Bit Windows pinnacle tv center for windows 7 power director price Best Photo Editor Software best buy Valtrex purchase Orlistat without a prescription overnight shipping how to buy replacement windows buy Flomax canada mediavatar video converter professional key serial key windows xp sp3 oem buy Flomax visa microsoft works windows 7 downloads turbocad best price pro adobe cs7 3d studio max 9 buy purchase no perscription Crestor Fincar without prescription windows xp home oem edition product key cheap valtrex purchase Flomax no prescription cheap cheap sperry mega sale data buy adobe cs5.5 master collection mac cheap mac snow leopard song Valtrex without rx overnight shipping motion builder midi device price vs 2010 price buy cheap fedex Prednisone Flomax cheap quarkxpres 6.0 ddl how to purchase Buspar online without rxcheap Buspar no rx do you have to buy software for online courses buy Buspar toronto adobe template buy Tamsulosin cheap cheap generic Valtrex Valtrex without doctor prescription how to order Zithromax online without prescription buy Bupropion online cheap buy Amitriptyline diet pills buy Zithromax 500 mg buy Buspar without rx prednisone online buy saturday delivery purchase cheap online prednisone order overnight prednisone buy Arimidex without a rx Valtrex cheap Windows 2000 Updates Buy Windows Xp X64 Windows 2000 Programs buy on line Valtrex Adobe Creative Suite Master Collection 3 acon digital media acoustica premium 4.1.0.382 Orlistat tablets buy Cytotec in chicago Autocad 2010 Best Price valtrex online purchase Buy Finpecia 1mg with visa Buspar buy Prednisone fedex shipping buy Zithromax with amex windows security system purchasing accutane 40 mg online without prescription buy finpecia amex online finpecia wholesale Discount Microsoft WindowsLightroom 2 Windows 7Ms Office StandardPhotoshop Cs5 UpgradeComputer Monitors For SaleWindows Xp InstallSuite Microsoft OfficeAutocad Version 2007Adobe Acrobat 9.0 Standard DownloadIe8 Download For Windows 7Adobe Paint ShopMicrosoft Service Pack 2Free Download Adobe AcrobatStudent And Teacher EditionManage ImageAdobe Acrobat 7 Pro DownloadVista Home Premium To Windows 7 UltimateWindows 7 Home Premium Upgrade OemAdobe Creative Suite 5 Master Collection Student And Teacher EditionBuy Adobe Photoshop Lightroom 3Ms Office 2010 Home And StudentCompare Photo SoftwareMicrosoft Office Word Viewer 2010Windows 7 Upgrade Student Discount ProfessionalWindows 7 Updates DownloadCreative Suite WebAdobe Reader VistaMicrosoft Windows 7 Home Premium Upgrade 64 BitPhotoshop 2Ie8 Download For Windows 7Photoshop 2009Suite Microsoft OfficeMicrosoft Office 2007 VersionUpgrade Windows Vista To 7Autocad Lt 2010Autocad 2010 Best PriceDownload Acrobat Reader 8 hd tune pro buy Softmaker Office 2010 adobe acrobat pdfmaker Buspar ohne rezept paragon mac product key telecharger windows server 2003 .iso Valtrex overdose Prednisone without rx order Buspar pay pal online without rx where can i purchase Valtrex no rx buy generic Valtrex Valtrex drug online pharmacy Proscar purchase Proscar without prescription from us pharmacy fedex Cytotec overnight without a prescription order Cytotec without a rx overnight shipping is it legal to buy Cytotec from canada buy finpecia with a mastercard uk finpecia generic free finpecia windows xp gadget microsoft word to buy windows xp professional password adobe reader software finpecia ohne rezept cheap downloadable software microsoft cheap discount software windows email security window screens windows media audio to mp3 windows will not open victorian window microsoft vista ultimate price windows malicious buy cheap Orlistat under without rx Rosuvastatin tabletten buspar no doctor prescription windows lve discount microsoft software for students desk help software