<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Design strike &#187; author box</title>
	<atom:link href="http://designstrike.net/tag/author-box/feed" rel="self" type="application/rss+xml" />
	<link>http://designstrike.net</link>
	<description>Striking with the latest design info</description>
	<lastBuildDate>Fri, 18 Jun 2010 13:51:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to make a author box in WordPress</title>
		<link>http://designstrike.net/development/how-to-make-a-author-box-in-wordpress.html</link>
		<comments>http://designstrike.net/development/how-to-make-a-author-box-in-wordpress.html#comments</comments>
		<pubDate>Tue, 06 Oct 2009 19:22:17 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[author box]]></category>
		<category><![CDATA[bio]]></category>

		<guid isPermaLink="false">http://designstrike.net/?p=1288</guid>
		<description><![CDATA[This simple technique will allow your article authors to display a bio and a Twitter link at the end of every article they write. The process is fully automatic, and the authors only need to fill in the required fields on their registration. This is a simple and effective way to give authors that link [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdesignstrike.net%2Fdevelopment%2Fhow-to-make-a-author-box-in-wordpress.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdesignstrike.net%2Fdevelopment%2Fhow-to-make-a-author-box-in-wordpress.html&amp;source=designstrike&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>This simple technique will allow your article authors to display a bio and a Twitter link at the end of every article they write. The process is fully automatic, and the authors only need to fill in the required fields on their registration.</p>
<p><img src="http://designstrike.net/wp-content/uploads/2009/10/result.gif" alt="result" title="result" width="600" height="164" class="alignnone size-full wp-image-1301" /></p>
<p>This is a simple and effective way to give authors that link love that they deserve for writing on your blog. The tutorial include some simple steps and code to set up. The tutorial is about setting up a author description and bio along with a Twitter link, and finally showing them inside a author box in WordPress.<br />
<span id="more-1288"></span></p>
<h2>Let`s get to work</h2>
<p>Open up your <strong>functions.php</strong> and paste in the following code. This code will make a Twitter field that authors need to fill inside the user edit screen of WordPress.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;tr&gt;
    &lt;th&gt;&lt;label for=&quot;twitter&quot;&gt;Twitter&lt;/label&gt;&lt;/th&gt;
&nbsp;
    &lt;td&gt;
        &lt;input type=&quot;text&quot; name=&quot;twitter&quot; id=&quot;twitter&quot; value=&quot;&lt;?php echo esc_attr( get_the_author_meta( 'twitter', $user-&gt;ID ) ); ?&gt;&quot; class=&quot;regular-text&quot; /&gt;&lt;br /&gt;
        &lt;span class=&quot;description&quot;&gt;Please enter your Twitter misname.&lt;/span&gt;
    &lt;/td&gt;
&lt;/tr&gt;</pre></div></div>

<p>And this is the actual result</p>
<p><img src="http://designstrike.net/wp-content/uploads/2009/10/twitter-area.gif" alt="twitter-area" title="twitter-area" width="600" height="164" class="alignnone size-full wp-image-1296" /></p>
<p>Keep in mind that if you want to display something else besides the Tiwtter link, the only thing you need to do is to copy the Twitter code and change every <strong>twitter</strong> instance inside the code into something unique.</p>
<p><strong>Now we need to save the links</strong></p>
<p>To allow wordpress to save your Twitter link you need to pop this code inside the functions.php file just below the Twitter code we inserted before.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'personal_options_update'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_save_extra_profile_fields'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'edit_user_profile_update'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_save_extra_profile_fields'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> my_save_extra_profile_fields<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$user_id</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>current_user_can<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'edit_user'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user_id</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">/* Copy and paste this line for additional fields. Make sure to change 'twitter' to the field ID. */</span>
    update_usermeta<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$user_id</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'twitter'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'twitter'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Now, we need to set up the actual author box we will display at the end of every post that author writes. Here is how you can achieve this:</p>
<p>Paste in the following code inside the <strong>functions.php</strong> file.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">function my_author_box() { ?&gt;
    &lt;div class=&quot;author-profile vcard&quot;&gt;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_avatar<span style="color: #009900;">&#40;</span> get_the_author_meta<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'user_email'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'96'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
        &lt;h4 class=&quot;author-name fn n&quot;&gt;Written by <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_author_posts_link<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h4&gt;
&nbsp;
        &lt;p class=&quot;author-description author-bio&quot;&gt;
            <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_author_meta<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'description'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
        &lt;/p&gt;
&nbsp;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> get_the_author_meta<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'twitter'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
            &lt;p class=&quot;twitter clear&quot;&gt;
                &lt;a href=&quot;http://twitter.com/<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_author_meta<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'twitter'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;Follow <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_author_meta<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'display_name'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> on Twitter&quot;&gt;Follow <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_author_meta<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'display_name'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> on Twitter&lt;/a&gt;
            &lt;/p&gt;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// End check for twitter ?&gt;</span>
    &lt;/div&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Next, let`s add the code inside our <strong>single.php</strong> file for our author box to show. So open up your single.php and paste the following code just before the comments code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> my_author_box<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>And that is the whole thing. Furthermore you can stylize the author box by adding some extra CSS code inside your style.css. This is my actual code and you can customize it to fit your own needs.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.author-profile</span>    <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#c5ecfb</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#0c529b</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.author-profile</span> img    <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.author-name</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">1.9em</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span>Georgia<span style="color: #00AA00;">,</span><span style="color: #ff0000;">&quot;Times New Roman&quot;</span><span style="color: #00AA00;">,</span>Times<span style="color: #00AA00;">,</span><span style="color: #993333;">serif</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.author-description</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#333333</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #3333ff;">:Verdana</span><span style="color: #00AA00;">,</span>Geneva<span style="color: #00AA00;">,</span><span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">13px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.twitter</span> a <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">1.4em</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#005ec1</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span><span style="color: #993333;">underline</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>And this is the actual result:</p>
<p><img src="http://designstrike.net/wp-content/uploads/2009/10/result.gif" alt="result" title="result" width="600" height="164" class="alignnone size-full wp-image-1301" /></p>
]]></content:encoded>
			<wfw:commentRss>http://designstrike.net/development/how-to-make-a-author-box-in-wordpress.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
