<?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>WP First Aid &#187; WordPress</title>
	<atom:link href="http://wpfirstaid.com/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpfirstaid.com</link>
	<description>NOT Just another WordPress weblog ... we are here to help.</description>
	<lastBuildDate>Mon, 26 Jul 2010 02:05:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Add the_shortlink()</title>
		<link>http://wpfirstaid.com/2010/07/add-the_shortlink/</link>
		<comments>http://wpfirstaid.com/2010/07/add-the_shortlink/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 20:20:35 +0000</pubDate>
		<dc:creator>The Doctor</dc:creator>
				<category><![CDATA[Functions]]></category>
		<category><![CDATA[the_shortlink]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://wpfirstaid.com/?p=698</guid>
		<description><![CDATA[I believe there are many reasons for themes to use this function or add it to your WordPress web site. I will briefly discuss a couple of the ones that come to mind. Note, if you are using the default permalink structure this may not be for you as the_shortlink() creates a URL that looks [...]]]></description>
			<content:encoded><![CDATA[<p>I believe there are many reasons for themes to use this function or add it to your <a href="http://wordpress.org">WordPress</a> web site. I will briefly discuss a couple of the ones that come to mind. Note, if you are using the default <a href="http://codex.wordpress.org/Using_Permalinks">permalink structure</a> this may not be for you as <a href="http://codex.wordpress.org/Function_Reference/the_shortlink"><em>the_shortlink()</em></a> creates a <abbr title="Uniform Resource Locator">URL</abbr> that looks just like it.</p>
<p>If you are new to WordPress and are still experimenting with the permalink structure to best fit your needs, you might consider using this function to create internal links for your site. Using the <abbr title="Uniform Resource Locator">URL</abbr> generated by <em>the_shortlink()</em> will always resolve correctly, using the verbose <abbr title="Uniform Resource Locator">URL</abbr> of the permalink structure may cause issues if you change the structure and do not <strong>manually edit all</strong> the internal links you have previously posted.</p>
<p>Please note, by &#8220;internal links&#8221; I am refering to the links used within the content of a post or page on your site pointing to another post or page on your site. A WordPress installation has the &#8220;smarts&#8221; to correctly resolve the links it generates if you change the permalink structure but it will not go back and &#8220;fix&#8221; anything you manually typed yourself as part of your page or post entry.</p>
<p>There is great potential for the user, the designer, and the developer using this function. I recommend adding it to all themes. Here is the most basic default usage of <em>the_shortlink()</em>:</p>
<pre class="brush: php;">&lt;?php the_shortlink(); ?&gt;</pre>
<p>This is the code I have decided to use on this site:</p>
<pre class="brush: php;">&lt;?php the_shortlink( __('Short Link'), '', ' &amp;#124; ', '' ); ?&gt;</pre>
<p>&#8230; which you can see just after the comments or subscribe link in the post meta details.</p>
<p>Of course you can always use the &#8216;Get Shortlink&#8217; button found on the page and post administration panels to get your shortlink, but making use of this single line of code allows your readers to gain that same benefit, too.</p>
<div class="nota-bene">
NB: If you have the <a href="http://wordpress.org/extend/plugins/stats/">WordPress.com Stats</a> plugin installed and activated, the_shortlink() function will use the <a href="http://wp.me">wp.me</a> link shortening service; and, it will retain all of the usefulness I noted above.
</div>
]]></content:encoded>
			<wfw:commentRss>http://wpfirstaid.com/2010/07/add-the_shortlink/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrade wp_list_categories() to wp_nav_menu()</title>
		<link>http://wpfirstaid.com/2010/07/upgrade-wp_list_categories-to-wp_nav_menu/</link>
		<comments>http://wpfirstaid.com/2010/07/upgrade-wp_list_categories-to-wp_nav_menu/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 13:39:07 +0000</pubDate>
		<dc:creator>The Doctor</dc:creator>
				<category><![CDATA[Functions]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wp_list_categories]]></category>
		<category><![CDATA[wp_nav_menu]]></category>

		<guid isPermaLink="false">http://wpfirstaid.com/?p=659</guid>
		<description><![CDATA[In this third installment in the upgrade to wp_nav_menu() series of posts, I will be dealing with moving from wp_list_categories() to wp_nav_menu(). Let&#8217;s start with the same basic outline and list the default options for each function. We will start with wp_nav_menu() 1 first: wp_nav_menu( array( 'menu' =&#62; '', 'container' =&#62; 'div', 'container_class' =&#62; '', [...]]]></description>
			<content:encoded><![CDATA[<p>In this third installment in the upgrade to <em>wp_nav_menu()</em> series of posts, I will be dealing with moving from <em>wp_list_categories()</em> to <em>wp_nav_menu()</em>.</p>
<p>Let&#8217;s start with the same basic outline and list the default options for each function. We will start with <em>wp_nav_menu()</em><sup> 1</sup> first:</p>
<pre class="brush: php;">
wp_nav_menu( array(
    'menu'              =&gt; '',
    'container'         =&gt; 'div',
    'container_class'   =&gt; '',
    'container_id'      =&gt; '',
    'menu_class'        =&gt; 'menu',
    'menu_id'           =&gt; '',
    'echo'              =&gt; true,
    'fallback_cb'       =&gt; 'wp_page_menu',
    'before'            =&gt; '',
    'after'             =&gt; '',
    'link_before'       =&gt; '',
    'link_after'        =&gt; '',
    'depth'             =&gt; 0,
    'walker'            =&gt; '',
    'theme_location'    =&gt; ''
    ) );
</pre>
<p>We follow with <em>wp_list_categories()</em><sup> 2, 3</sup> which is often wrapped in a &lt;ul class=&#8221;menu&#8221;&gt; tag:</p>
<pre class="brush: php;">
&lt;ul class=&quot;menu&quot;&gt;
wp_list_categories( array(
    'include'           =&gt; '',
    'exclude'           =&gt; '',
    'exclude_tree'      =&gt; '',
    'child_of'          =&gt; 0,
    'hide_empty'        =&gt; 1,
    'orderby'           =&gt; 'name',
    'order'             =&gt; 'ASC',
    'use_desc_for_title'=&gt; 1,
    'number'            =&gt; NULL,
    'hierarchical'      =&gt; true,
    'show_count'        =&gt; 0,
    'pad_counts'        =&gt; 0,
    'style'             =&gt; 'list',
    /* 'style' set to list &quot;creates list items for an unordered list&quot; */
    'show_option_all'   =&gt; '',
    'show_option_none'  =&gt; __('No categories'),
    'show_last_update'  =&gt; 0,
    'feed'              =&gt; '',
    'feed_type'         =&gt; '',
    'feed_image'        =&gt; '',
    'current_category'  =&gt; 0,
    'taxonomy'          =&gt; 'category',
    'title_li'          =&gt; __( '' ),
    /* 'title_li' set to '' for menus from the default 'Categories' */
    'echo'              =&gt; 1,
    'depth'             =&gt; 0,
    'walker'            =&gt; 'Walker_Category'
    ) );
&lt;/ul&gt;
</pre>
<p>Here is the break-down of the <em>wp_list_categories()</em> default options from above:</p>
<ul>
<li><code>'include'</code> &#8211; not used</li>
<li><code>'exclude'</code> &#8211; not used</li>
<li><code>'exclude_tree'</code> &#8211; not used</li>
<li><code>'child_of'</code> &#8211; not used</li>
<li><code>'hide_empty'</code> &#8211; not used</li>
<li><code>'orderby'</code> &#8211; not used</li>
<li><code>'order'</code> &#8211; not used</li>
<li><code>'use_desc_for_title'</code> &#8211; not used</li>
<li><code>'number'</code> &#8211; not used</li>
<li><code>'hierarchical'</code> &#8211; not used</li>
<li><code>'show_count'</code> &#8211; not used</li>
<li><code>'pad_counts'</code> &#8211; not used</li>
<li><code>'style'</code> &#8211; not used</li>
<li><code>'show_option_all'</code> &#8211; not available</li>
<li><code>'show_option_none'</code> &#8211; not available</li>
<li><code>'show_last_update'</code> &#8211; not available</li>
<li><code>'feed'</code> &#8211; not available</li>
<li><code>'feed_type'</code> &#8211; not available</li>
<li><code>'feed_image'</code> &#8211; not available</li>
<li><code>'current_category'</code> &#8211; not available</li>
<li><code>'taxonomy'</code> &#8211; not available</li>
<li><code>'title_li'</code> &#8211; not used</li>
<li><code>'echo'</code> – similar to wp_nav_menu(); true versus 1 as value</li>
<li><code>'depth'</code> – same as wp_nav_menu()</li>
<li><code>'walker'</code> &#8211; see below for additional notes</li>
</ul>
<p>Although there are great many options available to be used with <em>wp_list_categoires()</em> most are not used (as noted in the list above) in place of the user interface of <em>wp_nav_menu()</em> found under Appearance | Menu in the dashboard. The options that are marked as &#8220;not available&#8221; are currently not directly supported by <em>wp_nav_menu()</em> without the application of filters. The last few options remaining match up almost exactly with <em>wp_page_nav()</em> in a similar fashion as was shown with <em>wp_list_pages()</em>.</p>
<p>Just like the <em>wp_list_pages()</em> consideration, the <em>wp_nav_menu()</em> fallback_cb option may be set to <code>'fallback_cb' => 'wp_list_categories'</code>. This backward compatibility may also be addressed with a custom function as was noted, too.</p>
<p>Note: In most cases you would leave the <em>wp_nav_menu()</em> <code>'walker'</code> option set to its default <code>NULL</code> although <em>wp_list_categories()</em> uses its own default walker class.</p>
<div class="footnote">
<ol>Resources:</p>
<li><a href="http://core.trac.wordpress.org/browser/trunk/wp-includes/nav-menu-template.php">../wp-includes/nav-menu-template.php</a></li>
<li><a href="http://core.trac.wordpress.org/browser/trunk/wp-includes/category-template.php">../wp-includes/category-template.php</a></li>
<li><a href="http://codex.wordpress.org/Template_Tags/wp_list_categories">Template Tags/wp list categories</a></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://wpfirstaid.com/2010/07/upgrade-wp_list_categories-to-wp_nav_menu/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Upgrade wp_list_pages() to wp_nav_menu()</title>
		<link>http://wpfirstaid.com/2010/07/upgrade-wp_list_pages-to-wp_nav_menu/</link>
		<comments>http://wpfirstaid.com/2010/07/upgrade-wp_list_pages-to-wp_nav_menu/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 01:35:34 +0000</pubDate>
		<dc:creator>The Doctor</dc:creator>
				<category><![CDATA[Functions]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wp_list_pages]]></category>
		<category><![CDATA[wp_nav_menu]]></category>

		<guid isPermaLink="false">http://wpfirstaid.com/?p=584</guid>
		<description><![CDATA[A few options to address and with possibly a minor edit to the theme, you can upgrade wp_list_pages() easily to wp_nav_menu() in your theme.]]></description>
			<content:encoded><![CDATA[<p>Following in the series dealing with <a href="http://wpfirstaid.com/2010/07/upgrade-wp_page_menu-to-wp_nav_menu/">upgrading to the <em>wp_nav_menu()</em></a> function in <a href="http://wordpress.org">WordPress</a> 3.0 from menus derived from the template tags: <a href="http://codex.wordpress.org/Function_Reference/wp_page_menu"><em>wp_page_menu()</em></a>; <a href="http://codex.wordpress.org/Function_Reference/wp_list_pages"><em>wp_list_pages()</em></a>; and, <a href="http://codex.wordpress.org/Template_Tags/wp_list_categories"><em>wp_list_categories()</em></a>. This post will be covering the options involved in updating to <em>wp_nav_menu()</em> from <em>wp_list_pages()</em>.</p>
<p>Like the last post in the series we will look at the default arguments used by each function, starting with <em>wp_nav_menu()</em><sup> 1</sup>:</p>
<pre class="brush: php;">
wp_nav_menu( array(
    'menu'              =&gt; '',
    'container'         =&gt; 'div',
    'container_class'   =&gt; '',
    'container_id'      =&gt; '',
    'menu_class'        =&gt; 'menu',
    'menu_id'           =&gt; '',
    'echo'              =&gt; true,
    'fallback_cb'       =&gt; 'wp_page_menu',
    'before'            =&gt; '',
    'after'             =&gt; '',
    'link_before'       =&gt; '',
    'link_after'        =&gt; '',
    'depth'             =&gt; 0,
    'walker'            =&gt; '',
    'theme_location'    =&gt; ''
    ) );
</pre>
<p>The following is a default &#8220;menu&#8221; version of <em>wp_list_pages()</em><sup> 2, 3</sup>, often wrapped within a &lt;ul class=&#8221;menu&#8221;&gt; tag:</p>
<pre class="brush: php;">
&lt;ul class=&quot;menu&quot;&gt;
&lt;?php wp_list_pages( array(
    'sort_column'       =&gt; 'menu_order, post_title',
    'include'           =&gt; '',
    'exclude'           =&gt; '',
    'exclude_tree'      =&gt; '',
    'child_of'          =&gt; 0,
    'show_date'         =&gt; '',
    'date_format'       =&gt; get_option('date_format'),
    'title_li'          =&gt; __(''),
    /* 'title_li' set to '' for menus from the default 'Pages' */
    'authors'           =&gt; '',
    'echo'              =&gt; 1,
    'link_before'       =&gt; '',
    'link_after'        =&gt; '',
    'depth'             =&gt; 0,
    'walker'            =&gt; ''
    ) ); ?&gt;
&lt;/ul&gt;
</pre>
<p>Here is the break-down of the <em>wp_list_pages()</em> default options from above:</p>
<ul>
<li><code>'sort_column'</code> &#8211; not used</li>
<li><code>'include'</code> &#8211; not used</li>
<li><code>'exclude'</code> &#8211; not used</li>
<li><code>'exclude_tree'</code> &#8211; not used</li>
<li><code>'child_of'</code> &#8211; not used</li>
<li><code>'show_date'</code> &#8211; not used</li>
<li><code>'date_format'</code> &#8211; not used</li>
<li><code>'title_li'</code> &#8211; not used, see below for additional notes</li>
<li><code>'authors'</code> &#8211; not used</li>
<li><code>'echo'</code> &#8211; similar to wp_nav_menu(); true versus 1 as value</li>
<li><code>'link_before'</code> &#8211; same as wp_nav_menu()</li>
<li><code>'link_after'</code> &#8211; same as wp_nav_menu()</li>
<li><code>'depth'</code> &#8211; same as wp_nav_menu()</li>
<li><code>'walker'</code> &#8211; same as wp_nav_menu()</li>
</ul>
<p>Similar to <em>wp_page_menu()</em>, the &#8216;sort_column&#8217;, &#8216;include&#8217;, &#8216;exclude&#8217;, &#8216;exclude_tree&#8217;, and &#8216;child_of&#8217; are replaced via the end-user&#8217;s specific choices. The &#8216;show_date&#8217; and its related &#8216;date_format&#8217; option, as well as the &#8216;author&#8217; argument, are not available within the default <em>wp_nav_menu()</em> structure. Once again, the balance of the default options in <em>wp_list_pages()</em> matches the defaults found in <em>wp_nav_menu()</em>.</p>
<p>Also consider setting the <em>wp_nav_menu()</em> fallback_cb option to <code>'fallback_cb' => 'wp_list_pages'</code>. This backward compatibility may also be addressed with a custom function as <a href="http://www.nkuttler.de/2010/06/08/wp_nav_menu-wordpress-3-0/">posted by Nicolas Kuttler</a>.</p>
<p>Note: If the <code>'title_li' => __('')</code> option was being used it may also require the removal of the wrapping &lt;ul&gt; tag in the existing menu structure created with <em>wp_list_pages()</em>.</p>
<div class="footnote">
<ol>Resources:</p>
<li><a href="http://core.trac.wordpress.org/browser/trunk/wp-includes/nav-menu-template.php">../wp-includes/nav-menu-template.php</a></li>
<li><a href="http://core.trac.wordpress.org/browser/trunk/wp-includes/post-template.php">../wp-includes/post-template.php</a></li>
<li><a href="http://codex.wordpress.org/Function_Reference/wp_list_pages">Function Reference/wp list pages</a></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://wpfirstaid.com/2010/07/upgrade-wp_list_pages-to-wp_nav_menu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Upgrade wp_page_menu() to wp_nav_menu()</title>
		<link>http://wpfirstaid.com/2010/07/upgrade-wp_page_menu-to-wp_nav_menu/</link>
		<comments>http://wpfirstaid.com/2010/07/upgrade-wp_page_menu-to-wp_nav_menu/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 23:46:26 +0000</pubDate>
		<dc:creator>The Doctor</dc:creator>
				<category><![CDATA[Functions]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wp_nav_menu]]></category>
		<category><![CDATA[wp_page_menu]]></category>

		<guid isPermaLink="false">http://wpfirstaid.com/?p=552</guid>
		<description><![CDATA[Upgrading from wp_page_menu() to wp_nav_menu() may be as easy as a simple find and replace operation.]]></description>
			<content:encoded><![CDATA[<p>WordPress version 3.0 has been live for a while and a lot of people want to make use of the <a href="http://codex.wordpress.org/Function_Reference/wp_nav_menu"><em>wp_nav_menu()</em></a> functionality but they are using one of the older template tags: <a href="http://codex.wordpress.org/Function_Reference/wp_page_menu"><em>wp_page_menu()</em></a>; <a href="http://codex.wordpress.org/Function_Reference/wp_list_pages"><em>wp_list_pages()</em></a>; or, <a href="http://codex.wordpress.org/Template_Tags/wp_list_categories"><em>wp_list_categories()</em></a>.</p>
<p>This post will be dealing with function arguments in common between <em>wp_nav_menu()</em> and <em>wp_page_menu()</em>. Follow-up posts will be covering <a href="http://wpfirstaid.com/2010/07/upgrade-wp_list_pages-to-wp_nav_menu/"><em>wp_list_pages()</em></a> and <a href="http://wpfirstaid.com/2010/07/upgrade-wp_list_categories-to-wp_nav_menu/"><em>wp_list_categories()</em></a>.  I will not be covering the specific use for each function&#8217;s arguments; the idea is to help show how these options correlate to one another.</p>
<p>Let&#8217;s start with the full default of <em>wp_nav_menu()</em><sup> 1</sup> explicitly displayed:</p>
<pre class="brush: php;">
wp_nav_menu( array(
    'menu'              =&gt; '',
    'container'         =&gt; 'div',
    'container_class'   =&gt; '',
    'container_id'      =&gt; '',
    'menu_class'        =&gt; 'menu',
    'menu_id'           =&gt; '',
    'echo'              =&gt; true,
    'fallback_cb'       =&gt; 'wp_page_menu',
    'before'            =&gt; '',
    'after'             =&gt; '',
    'link_before'       =&gt; '',
    'link_after'        =&gt; '',
    'depth'             =&gt; 0,
    'walker'            =&gt; '',
    'theme_location'    =&gt; ''
    ) );
</pre>
<p>Followed by the same explicit defaults of <em>wp_page_menu()</em><sup> 2, 3</sup>:</p>
<pre class="brush: php;">
wp_page_menu( array(
    'sort_column'       =&gt; 'menu_order, post_title',
    'include'           =&gt; '',
    'exclude'           =&gt; '',
    'show_home'         =&gt; false,
    'menu_class'        =&gt; 'menu',
    'echo'              =&gt; true,
    'link_before'       =&gt; '',
    'link_after'        =&gt; ''
    ) );
</pre>
<p>Now onto updating <em>wp_page_menu()</em> to <em>wp_nav_menu()</em>, which turns out to be rather simple.</p>
<p>Here is the break-down of the <em>wp_page_menu()</em> default options from above:</p>
<ul>
<li><code>'sort_column'</code> &#8211; not used</li>
<li><code>'include'</code> &#8211; not used</li>
<li><code>'exclude'</code> &#8211; not used</li>
<li><code>'show_home'</code> &#8211; not used (see bonus section below)</li>
<li><code>'menu_class'</code> &#8211; same as wp_nav_menu()</li>
<li><code>'echo'</code> &#8211; same as wp_nav_menu()</li>
<li><code>'link_before'</code> &#8211; same as wp_nav_menu()</li>
<li><code>'link_after'</code> &#8211; same as wp_nav_menu()</li>
</ul>
<p>First off &#8216;sort_column&#8217;, &#8216;include&#8217;, and &#8216;exclude&#8217; are replaced by the end-user&#8217;s choices using the <abbr title="User Interface">UI</abbr> of <em>wp_nav_menu()</em> found under Appearance | Menu in the dashboard. The balance of the default options are the same in <em>wp_nav_menu()</em>, with the exception of <code>'show_home' => false</code> which is the &#8220;bonus&#8221; content.</p>
<p>Upgrading from <em>wp_page_menu()</em> to <em>wp_nav_menu()</em> may be as easy as a simple find and replace operation.</p>
<div class="bonus">
<em>Bonus</em> &#8211; Although the default in <em>wp_page_menu()</em> does not show a home page link you can add a custom menu item in <em>wp_nav_menu()</em> if you want one to appear. You may need to edit your theme to remove the orginal &#8220;home&#8221; link if one was being generated before upgrading.
</div>
<div class="nota-bene">
NB: You may also need to add this line of code to your &#8216;functions.php&#8217; template file to add custom menu support to your theme: <code>add_theme_support( 'menus' );</code>
</div>
<div class="footnote">
<ol>Resources:</p>
<li><a href="http://core.trac.wordpress.org/browser/trunk/wp-includes/nav-menu-template.php">../wp-includes/nav-menu-template.php</a></li>
<li><a href="http://core.trac.wordpress.org/browser/trunk/wp-includes/post-template.php">../wp-includes/post-template.php</a></li>
<li><a href="http://codex.wordpress.org/Function_Reference/wp_page_menu">Function Reference/wp page menu</a></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://wpfirstaid.com/2010/07/upgrade-wp_page_menu-to-wp_nav_menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modified Post Function</title>
		<link>http://wpfirstaid.com/2010/03/modified-post-function/</link>
		<comments>http://wpfirstaid.com/2010/03/modified-post-function/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 19:14:33 +0000</pubDate>
		<dc:creator>The Doctor</dc:creator>
				<category><![CDATA[Functions]]></category>
		<category><![CDATA[get_the_date]]></category>
		<category><![CDATA[modified_post]]></category>
		<category><![CDATA[version_compare]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://wpfirstaid.com/?p=494</guid>
		<description><![CDATA[A simple function to show who modified a post last and when in WordPress versions 3.0 and greater.]]></description>
			<content:encoded><![CDATA[<p>Here is a simple bit of code you can drop into your <strong>functions.php</strong> file then use in any of your templates where you want to display a short statement telling when a post was last modified.</p>
<pre class="brush: php;">
// Modified Post - requires WordPress version 3.0 or greater
function modified_post(){
  global $wp_version;
  if (version_compare($wp_version, &quot;2.999&quot;, &quot;&gt;&quot;)) {
    /* If the post date and the last modified date are different display modified post details */
    if ( get_the_date() &lt;&gt; get_the_modified_date() ) {
      echo '&lt;div class=&quot;modified-post&quot;&gt;'; /* CSS wrapper for modified post details */
      echo 'Last modified by ' . get_the_modified_author() . ' on ' . get_the_modified_date();
      echo '&lt;/div&gt;&lt;!-- .modified-post --&gt;';
    }
  }
}
</pre>
<p>Of course, you may have noticed the check for <a href="http://wordpress.org/download/nightly/">WordPress version 3.0 or greater</a>. This is required as the function <em><a href="http://phpdoc.wordpress.org/trunk/WordPress/Template/_wp-includes---general-template.php.html#functionget_the_date">get_the_date()</a></em> on line 6 is currently only found in versions of WordPress starting at 3.0</p>
<p>Once the above code has been added to your <strong>functions.php</strong> file <em>and</em> you are using a version of <em>WordPress greater than or equal to 3.0</em> then all you need to do is drop the following line of code inside <a href="http://codex.wordpress.org/The_Loop">the loop</a> of the template file you want to display the modified post details on.</p>
<pre class="brush: plain; light: true;">&lt;?php modified_post(); ?&gt;</pre>
<p>Also included is a CSS class element for easy styling. The code can be easily edited to add more elements, too.</p>
<p>Now, what good is this little bit of code? Have a look around and see it in action.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpfirstaid.com/2010/03/modified-post-function/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress 3.0 Navigation Menu Styles</title>
		<link>http://wpfirstaid.com/2010/03/wordpress-3-0-navigation-menu-styles/</link>
		<comments>http://wpfirstaid.com/2010/03/wordpress-3-0-navigation-menu-styles/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 14:19:05 +0000</pubDate>
		<dc:creator>The Doctor</dc:creator>
				<category><![CDATA[Functions]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[register_sidebar]]></category>
		<category><![CDATA[settings]]></category>
		<category><![CDATA[widget]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wp_nav_menu]]></category>

		<guid isPermaLink="false">http://wpfirstaid.com/?p=418</guid>
		<description><![CDATA[A list of WordPress version 3.0 Navigation Menu default widget, and wp_nav_menu() function, generated CSS style elements.]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s jump right in &#8230;</p>
<p>Using the default definition from the <em><a href="http://codex.wordpress.org/Function_Reference/register_sidebar">register_sidebar()</a></em> function found in <em>../wp-includes/widgets.php</em> of WordPress version <del>3.0-alpha</del> 3.0-beta1<sup>2</sup> (see below):</p>
<pre class="brush: php; first-line: 551;">
	$defaults = array(
		'name' =&gt; sprintf(__('Sidebar %d'), $i ),
		'id' =&gt; &quot;sidebar-$i&quot;,
		'description' =&gt; '',
		'before_widget' =&gt; '&lt;li id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;',
		'after_widget' =&gt; &quot;&lt;/li&gt;\n&quot;,
		'before_title' =&gt; '&lt;h2 class=&quot;widgettitle&quot;&gt;',
		'after_title' =&gt; &quot;&lt;/h2&gt;\n&quot;,
	);
</pre>
<p>&#8230; and the default Navigation Menu widget, the following CSS style elements are generated:</p>
<ul>
<li>#nav-menu-&lt;widget instance></li>
<li>.widget</li>
<li>.widget_nav_menu</li>
<li>.widgettitle</li>
</ul>
<p>&#8230; with these elements generated specifically by the <em><a href="http://codex.wordpress.org/Function_Reference/wp_nav_menu">wp_nav_menu()</a></em> function found in <em>../wp-includes/default-widgets.php</em> of WordPress version <del>3.0-alpha</del> 3.0-beta1<sup>2</sup>:</p>
<ul>
<li>.menu-&lt;menu name>-container<sup>2</sup></li>
<li>#menu-&lt;menu name></li>
<li>.menu</li>
<li>#menu-item-&lt;unique identifier*></li>
<li><del>.menu-item-type-&lt;types: page, category, Custom></del><sup>1</sup></li>
<li>.menu-item<sup>2</sup></li>
<li>.menu-item-type-&lt;post_type, custom, or taxonomy><sup>2</sup></li>
<li>.menu-item-object-&lt;page, or category><sup>2</sup></li>
<li>.current_page_item</li>
<li>.sub-menu<sup>1</sup></li>
</ul>
<p>This is just an initial listing of my observations as of the March 16, 2010 3.0-alpha version of WordPress. Look for future updates; and, please feel free to make note of your own observations below.</p>
<p><em>Bonus</em> &#8211; A suggested addition to style.css for theme developers:</p>
<pre class="brush: css;">
/* WordPress 3.0 Navigation Menu default widget */
.widget_nav_menu .menu {margin: 0;}
.widget_nav_menu .menu li {
  display: block;
  float: none;
  /* text-align: left; */
}
</pre>
<div class="nota-bene"><abbr title="Nota Bene">*N.B.</abbr> &#8211; each new menu item generates its own post ID in the WordPress database &#8216;posts&#8217; table. This appears to be in a similar fashion to post revisions.</div>
<div class="footnote">
<ol>Notes:</p>
<li>Mar 21, 2010
<ul>
<li>menu item type class further defined</li>
<li>sub-menu class noted</li>
</ul>
</li>
<li>Apr 15, 2010 (3.0-beta1 updates)
<ul>
<li>additional menu classes defined and/or modified</li>
<li>new menu container class noted</li>
</ul>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://wpfirstaid.com/2010/03/wordpress-3-0-navigation-menu-styles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic Copyright</title>
		<link>http://wpfirstaid.com/2010/02/dynamic-copyright/</link>
		<comments>http://wpfirstaid.com/2010/02/dynamic-copyright/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 23:36:43 +0000</pubDate>
		<dc:creator>The Doctor</dc:creator>
				<category><![CDATA[Functions]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[bns_dynamic_copyright]]></category>
		<category><![CDATA[dynamic_copyright]]></category>
		<category><![CDATA[get_posts]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://wpfirstaid.com/?p=363</guid>
		<description><![CDATA[Add a dynamic copyright function to your WordPress theme. Just use the sample code and instructions in this post.]]></description>
			<content:encoded><![CDATA[<p>At the bottom of most blogs you will find the commonplace copyright notice that may look something like this:</p>
<blockquote><p>Copyright &copy; 2010 <strong>WP First Aid</strong> All rights reserved.</p></blockquote>
<p>Which begs the question, what about those posts made before the year 2010? This is where a dynamic copyright function would come in very handy. It would be more correct to have this display in the footer:</p>
<blockquote><p>Copyright &copy; 2009-2010 <strong>WP First Aid</strong> All rights reserved.</p></blockquote>
<p>Most <a href="http://wordpress.org/">WordPress</a> <a href="http://wordpress.org/extend/themes/">themes</a> will include, at a minimum, code that will generate a <em>current year</em> copyright statement, perhaps something along these lines:</p>
<pre class="brush: xml;">&lt;?php _e( 'Copyright &amp;copy; ' ); ?&gt;
&lt;?php echo date( 'Y' ); ?&gt;
&lt;strong&gt; &lt;?php bloginfo( 'name' ); ?&gt; &lt;/strong&gt;
&lt;?php _e( 'All rights reserved.' ); ?&gt;</pre>
<p>To make this code into a function and add some dynamics lets start with a simple PHP construct:</p>
<pre class="brush: php;">function dynamic_copyright() {
  // code goes here
}</pre>
<p>To get the first year a post was written on the blog we need to find the first post. This can be done with this code snippet:</p>
<pre class="brush: php; first-line: 2;">
  $all_posts = get_posts( 'order=ASC' );
  $first_post = $all_posts[0];
  $first_date = $first_post-&gt;post_date_gmt;
</pre>
<p>We started by getting all of the posts with the <a href="http://codex.wordpress.org/Function_Reference/get_posts">get_posts()</a> function. We assigned the first post, which is found at index 0 (zero) to its own variable. Then we assign that post&#8217;s date (in GMT) to its own variable.</p>
<p>We now have isolated the date of the first post on the blog and can perform further operations on it. The basic dynamic part of the function is complete. If the first post is removed and the &#8220;new&#8221; first post has a different date, then the above snippet will simply use the new post&#8217;s date.</p>
<p>The balance of the function is only a slight modification of the original &#8220;minimum&#8221; sample code from above:</p>
<pre class="brush: php; first-line: 5; highlight: [6];">
  _e( 'Copyright &amp;copy; ' );
  echo substr( $first_date, 0 ,4 ) . &quot;-&quot; . date( 'Y' );
  echo ' &lt;strong&gt;' . get_bloginfo( 'name' ) . '&lt;/strong&gt; ';
  _e( 'All rights reserved.' );
</pre>
<p>The key is highlighted at line 6. We <strong>echo</strong>, or display, the first four characters of the <strong>$first_date</strong> string which is the year; add a hyphen; and, then call a standard PHP function to add the current year as a four digit representation.</p>
<p>Here is the entire <strong>dynamic_copyright()</strong> function, including comments:</p>
<pre class="brush: php;">function bns_dynamic_copyright() {
  /* Get all posts */
  $all_posts = get_posts( 'post_status=publish&amp;order=ASC' );
  /* Get first post */
  $first_post = $all_posts[0];
  /* Get date of first post */
  $first_date = $first_post-&gt;post_date_gmt;

  /* Display common footer copyright notice */
  _e( 'Copyright &amp;copy; ' );
  /* Display first post year and current year */
  if ( substr( $first_date, 0, 4 ) == date( 'Y' ) ) {
  /* Only display current year if no posts in previous years */
    echo date( 'Y' );
  } else {
    echo substr( $first_date, 0, 4 ) . &quot;-&quot; . date( 'Y' );
  }
  /* Display blog name from 'General Settings' page */
  echo ' &lt;strong&gt;' . get_bloginfo( 'name' ) . '&lt;/strong&gt; ';
  _e( 'All rights reserved.' );
}
</pre>
<p>Of course, this function is compliments of <a href="http://buynowshop.com/">BuyNowShop.com</a> and has their customary <strong>bns</strong> prefix as it will be appearing in all of their themes.</p>
<p>Just like I did, you can copy and paste the entire sample <strong>bns_dynamic_copyright()</strong> code above into your theme&#8217;s <em>functions.php</em> file; then, replace the code in your theme&#8217;s <em>footer.php</em> file that generates your old <em>static</em> copyright notice with this line of code:</p>
<pre class="brush: xml;">&lt;?php bns_dynamic_copyright(); ?&gt;</pre>
<p>Your theme will now display a dynamic copyright notice as you continue your writings for many years to come. Congratulations!</p>
]]></content:encoded>
			<wfw:commentRss>http://wpfirstaid.com/2010/02/dynamic-copyright/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Your Username Can Be Changed</title>
		<link>http://wpfirstaid.com/2010/02/your-username-can-be-changed/</link>
		<comments>http://wpfirstaid.com/2010/02/your-username-can-be-changed/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 17:33:39 +0000</pubDate>
		<dc:creator>The Doctor</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[change]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[username]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://wpfirstaid.com/?p=333</guid>
		<description><![CDATA[The login username for a WordPress self-hosted installation can be changed. Just follow these steps.]]></description>
			<content:encoded><![CDATA[<p>Changing a username in WordPress cannot be done within the WordPress interfaces, but it is still easy to do &#8230; providing you have access to the WordPress database.</p>
<div id="attachment_334" class="wp-caption aligncenter" style="width: 310px"><a href="http://wpfirstaid.com/wp-content/uploads/2010/02/Profile.png"><img src="http://wpfirstaid.com/wp-content/uploads/2010/02/Profile-300x150.png" alt="" title="Profile" width="300" height="150" class="size-medium wp-image-334" /></a><p class="wp-caption-text">A snippet of the Profile screen</p></div>
<p><em>NB: This tip is offered under the premise you are using a self-hosted installation of <a href="http://wordpress.org/download/">WordPress</a> and your web host provider has installed the <a href="http://www.cpanel.net/">cPanel</a> application to allow you to manage your web site.</em></p>
<p>Let&#8217;s start &#8230;</p>
<ol>
<li>Access the cPanel for your web site; and, locate the phpMyAdmin applet, it is generally found in the Databases section.</li>
<li>Start phpMyAdmin.</li>
<li>Locate and access your WordPress database.</li>
<li>Find the <strong>wp_users</strong> table</li>
</ol>
<div id="attachment_337" class="wp-caption aligncenter" style="width: 496px"><a href="http://wpfirstaid.com/wp-content/uploads/2010/02/wp_users.png"><img src="http://wpfirstaid.com/wp-content/uploads/2010/02/wp_users.png" alt="" title="wp_users" width="486" height="118" class="size-full wp-image-337" /></a><p class="wp-caption-text">wp_users table in your WordPress database</p></div>
<p>Next, click on the left most icon to browse the users in the wp_users table.</p>
<div id="attachment_349" class="wp-caption aligncenter" style="width: 610px"><a href="http://wpfirstaid.com/wp-content/uploads/2010/02/browse_users.png"><img src="http://wpfirstaid.com/wp-content/uploads/2010/02/browse_users.png" alt="" title="Browse Users" width="600" height="54" class="size-full wp-image-349" /></a><p class="wp-caption-text">The user list</p></div>
<p>Then, click on the &#8220;pencil&#8221; icon beside the user you wish to edit. This will display the screen we will be using to change the username.</p>
<div id="attachment_351" class="wp-caption aligncenter" style="width: 610px"><a href="http://wpfirstaid.com/wp-content/uploads/2010/02/user_edit.png"><img src="http://wpfirstaid.com/wp-content/uploads/2010/02/user_edit.png" alt="" title="User Edit" width="600" height="360" class="size-full wp-image-351" /></a><p class="wp-caption-text">The edit user screen</p></div>
<p>Now, edit the <strong>user_login</strong> (and the <strong>user_nicename</strong>) to your new login username. Click on the &#8220;GO&#8221; button in the bottom right corner (not shown in the image) of the edit screen. <em>Voila!</em></p>
<p>You can now change the username in a WordPress self-hosted installation. Well Done!</p>
<p><em>PS: Applying this technique using other methods to access the database is possible, this one only deals with using the <a href="http://www.cpanel.net/">cPanel</a> / <a href="http://www.phpmyadmin.net/">phpMyAdmin</a> combination.</em></p>
<p><em>PPS: Remember to <u>make back-ups</u>! Always!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://wpfirstaid.com/2010/02/your-username-can-be-changed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calendar Default Widget Broken</title>
		<link>http://wpfirstaid.com/2010/01/calendar-default-widget-broken/</link>
		<comments>http://wpfirstaid.com/2010/01/calendar-default-widget-broken/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 21:01:20 +0000</pubDate>
		<dc:creator>The Doctor</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[trac]]></category>
		<category><![CDATA[widget]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://wpfirstaid.com/?p=324</guid>
		<description><![CDATA[WordPress' calendar default widget having issues displaying months correctly. See this ticket at trac: #11414]]></description>
			<content:encoded><![CDATA[<p>I just happened to notice this today. The calendar default widget that comes with WordPress is having issues. It appears to work fine on the initial visit to a blog&#8217;s home page, but if you start reading the archives, especially using the calendar as a navigation tool you may find the calendar using some very oddly structured months.</p>
<p>Here is the trac ticket: <a href="http://core.trac.wordpress.org/ticket/11414">http://core.trac.wordpress.org/ticket/11414</a>, so it is being addressed.</p>
<p>In the meantime, I have decided to install the <a href="http://wordpress.org/extend/plugins/ajax-calendar/">Ajax Calendar</a> plugin as a substitute. There are many other calendar plugins available but this one suits my current needs.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpfirstaid.com/2010/01/calendar-default-widget-broken/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>No Widget Area &#8230;</title>
		<link>http://wpfirstaid.com/2010/01/no-widget-area/</link>
		<comments>http://wpfirstaid.com/2010/01/no-widget-area/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 04:23:31 +0000</pubDate>
		<dc:creator>The Doctor</dc:creator>
				<category><![CDATA[Functions]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[the_widget]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://wpfirstaid.com/?p=223</guid>
		<description><![CDATA[Making a template tag for standard plugins using the built-in WordPress function the_widget().]]></description>
			<content:encoded><![CDATA[<p>&hellip; no problem! Thanks to the introduction of <code>the_widget()</code> function in <a href="http://codex.wordpress.org/Version_2.8">WordPress 2.8</a> &hellip; and this post.</p>
<p>Using a sample plugin (download zip file below) I will show you a simple how-to that makes use of <code>the_widget()</code> function. There is no codex page at <a href="http://wordpress.org">WordPress.org</a> for this function as of this writing, but there are some references you can find:</p>
<ul>
<li><a href="https://core.trac.wordpress.org/ticket/9701">WordPress trac ticket #9701</a></li>
<li><a href="http://phpdoc.wordpress.org/trunk/WordPress/Widgets/_wp-includes---widgets.php.html#functionthe_widget">WordPress trunk reference</a></li>
</ul>
<p>The &#8220;trunk&#8221; reference provides an easy to follow layout of the function:</p>
<pre class="brush: plain; light: true;">the_widget (line 1291 in file ../wp-includes/widget.php)

Output an arbitrary widget as a template tag

    * since: 2.8

void the_widget (string $widget, [array $instance = array()], [array $args = array()])

    * string $widget: the widget's PHP class name (see default-widgets.php)
    * array $instance: the widget's instance settings
    * array $args: the widget's sidebar args
</pre>
<p>We are going to use the sample plugin to replace the values in the function. We will start with this:</p>
<pre class="brush: php;">&lt;?php /* Using the_widget() to make a plugin template tag */
the_widget(
  string $widget,
  $instance = array(),
  $args = array ()
);
/* NB: This will not work ... yet! */ ?&gt;
</pre>
<p>First we will replace the &#8220;string $widget&#8221; with the plugin class name (see line 19):</p>
<pre class="brush: php; highlight: [19];">&lt;?php
/*
Plugin Name: WPFirstAid Sample Widget
Plugin URI: http://wpfirstaid.com
Description: Plugin with multi-widget functionality that displays stuff ...
Version: 0.1
Author: Edward Caissie
Author URI: http://edwardcaissie.com/
*/

/* Add function to the widgets_init hook. */
add_action( 'widgets_init', 'load_my_wpfa_sample_widget' );

/* Function that registers our widget. */
function load_my_wpfa_sample_widget() {
	register_widget( 'WPFA_Sample_Widget' );
}

class WPFA_Sample_Widget extends WP_Widget {

	function WPFA_Sample_Widget() {
      /* Widget settings. */
  		$widget_ops = array('classname' =&gt; 'wpfa-sample', 'description' =&gt; __('Displays some stuff.'));
  		/* Widget control settings. */
  		$control_ops = array('width' =&gt; 200, 'height' =&gt; 200, 'id_base' =&gt; 'wpfa-sample');
  		/* Create the widget. */
  		$this-&gt;WP_Widget('wpfa-sample', 'WPFirstAid Sample', $widget_ops, $control_ops);
  	}

	function widget( $args, $instance ) {
</pre>
<p>The function now looks like this:</p>
<pre class="brush: php;">&lt;?php /* Using the_widget() to make a plugin template tag */
the_widget(
  WPFA_Sample_Widget,
  $instance = array(),
  $args = array ()
);
/* NB: This will not work ... yet! */ ?&gt;
</pre>
<p>Next we will replace the &#8220;$instance = array()&#8221; part of the function with the appropriate code from the sample (see lines 70-75), in this sample case simply start with the &#8220;$defaults&#8221; values:</p>
<pre class="brush: php; first-line: 30; highlight: [70,71,72,73,74,75];">
	function widget( $args, $instance ) {
      extract( $args );
      /* User-selected settings. */
      $title        = apply_filters('widget_title', $instance['title'] );
      $choices      = $instance['choices'];
      $show_choices = $instance['show_choices'];
      $optionals    = $instance['optionals'];

      /* Before widget (defined by themes). */
      echo $before_widget;

      /* Title of widget (before and after defined by themes). */
      if ( $title )
        echo $before_title . $title . $after_title;

      /* Display stuff based on widget settings. */
      if ( $show_choices ) {
        echo $choices . ' is in ... step to your ' . $optionals;
      } else {
        echo __('No appointments today');
      }

      /* After widget (defined by themes). */
      echo $after_widget;
  }

	function update( $new_instance, $old_instance ) {
      $instance = $old_instance;

      /* Strip tags (if needed) and update the widget settings. */
      $instance['title']          = strip_tags( $new_instance['title'] );
      $instance['choices']        = strip_tags( $new_instance['choices'] );
      $instance['show_choices']   = $new_instance['show_choices'];
      $instance['optionals']      = $new_instance['optionals'];

      return $instance;
  }

  function form( $instance ) {
      /* Set default widget settings. */
      $defaults = array(
          'title'                 =&gt; __('WPFirstAid Sample'),
          'choices'               =&gt; 'The Doctor',
          'show_choices'          =&gt; true,
          'optionals'             =&gt; 'right'
      );
      $instance = wp_parse_args( (array) $instance, $defaults );
		?&gt;

		&lt;p&gt;
			&lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id( 'title' ); ?&gt;&quot;&gt;&lt;?php _e('Title:'); ?&gt;&lt;/label&gt;
</pre>
<p>The function now looks like this:</p>
<pre class="brush: php;">&lt;?php /* Using the_widget() to make a plugin template tag */
the_widget(
  WPFA_Sample_Widget,
  $instance = array(
        'title'                 =&gt; __('WPFirstAid Sample'),
        'choices'               =&gt; 'The Doctor',
        'show_choices'          =&gt; true,
        'optionals'             =&gt; 'right'
  ),
  $args = array ()
);
/* NB: This will not work ... yet! */ ?&gt;
</pre>
<p>Now we just need to replace the last parameter, &#8220;$args = array()&#8221; with the appropriate information. Depending on the theme, and whether or not there exists widget areas in the theme, the simplest place to start is with clearing the standard widget arguments that reference before and after the widget, as well as before and after the widget title. The function will now look like this:</p>
<pre class="brush: php;">&lt;?php /* Using the_widget() to make a plugin template tag */
the_widget(
  WPFA_Sample_Widget,
  $instance = array(
        'title'                 =&gt; __('WPFirstAid Sample'),
        'choices'               =&gt; 'The Doctor',
        'show_choices'          =&gt; true,
        'optionals'             =&gt; 'right'
  ),
  $args = array (
  'before_widget'   =&gt; '',
  'before_title'    =&gt; '',
  'after_title'     =&gt; '',
  'after_widget'    =&gt; ''
  )
);
/* NB: This will work, now! */ ?&gt;
</pre>
<p>Just copy and paste into your theme; and, after making suitable changes to match your installed active plugin, it will now be used like a template tag!</p>
<p>Well Done! and, here is the sample plugin: <a class="downloadlink" href="http://wpfirstaid.com/wp-downloads/wpfa-sample-widget.zip" title="Version0.1 downloaded 47 times" >WPFirstAid Sample Widget (47)</a>. Enjoy!</p>
<p><em>This post was inspired by <a href="http://buynowshop.com/plugins/bns-featured-category/comment-page-1/#comment-663">this comment</a> at <a href="http://buynowshop.com">BuyNowShop.com</a>, thank you @finid.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://wpfirstaid.com/2010/01/no-widget-area/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
