<?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</title>
	<atom:link href="http://wpfirstaid.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpfirstaid.com</link>
	<description>It&#039;s WordPress ... anything is possible!</description>
	<lastBuildDate>Thu, 26 Apr 2012 14:24:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-beta4-20725</generator>
		<item>
		<title>Just __return_* It</title>
		<link>http://wpfirstaid.com/2012/04/just-return-it/</link>
		<comments>http://wpfirstaid.com/2012/04/just-return-it/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 14:42:41 +0000</pubDate>
		<dc:creator>The Doctor</dc:creator>
				<category><![CDATA[Functions]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[__return_empty_array]]></category>
		<category><![CDATA[__return_false]]></category>
		<category><![CDATA[__return_null]]></category>
		<category><![CDATA[__return_true]]></category>
		<category><![CDATA[__return_zero]]></category>

		<guid isPermaLink="false">http://wpfirstaid.com/?p=1178</guid>
		<description><![CDATA[WordPress has a lot of helper functions built into its core. Some of these functions are obvious and some are obscure &#8230; and almost every one of them can be easily put to use. A chat group I was in the other day lead me to looking for a set of these helper functions in [...]]]></description>
			<content:encoded><![CDATA[<p><a title="WordPress-dot-org" href="http://wordpress.org/">WordPress</a> has a lot of helper functions built into its core. Some of these functions are obvious and some are obscure &#8230; and almost every one of them can be easily put to use.</p>
<p>A chat group I was in the other day lead me to looking for a set of these helper functions in the code we were discussing &#8230; I didn&#8217;t find them. Well, I did find them in use but I did not find where they were defined. Next stop, the <a title="phpDocumentor - WordPress trunk" href="http://phpdoc.wordpress.org/trunk/">WordPress core</a> &#8230; and there they were.</p>
<p>Now, as the title may suggest I am referring to the following WordPress core functions:</p>
<ul>
<li><em>__return_true()</em> &#8211; returns the Boolean state of true</li>
<li><em>__return_false()</em> &#8211; returns the Boolean state of false</li>
<li><em>__return_zero()</em> &#8211; returns a value of zero (0)</li>
<li><em>__return_empty_array()</em> &#8211; returns an empty array, as in <em>array()</em></li>
<li><em>__return_null()</em> &#8211; returns null (or void)</li>
</ul>
<p>All of these functions have a very similar structure and were implemented at WordPress version 3.0.0, with the exception of `<em>__return_null</em>` which will be introduced at WordPress version 3.4 per their definitions in &#8216;<a title="../wp-includes/functions.php" href="http://phpdoc.wordpress.org/trunk/WordPress/_wp-includes---functions.php.html">../wp-includes/functions.php</a>&#8216;. For example, here is the code for `<em>__return_true</em>`:</p>
<pre class="brush: plain; title: ; notranslate">function __return_true() {
	return true;
}</pre>
<p>Why are these great helper functions? Simple really &#8230; they provide easy to remember, and very useful, callback functions for filters. You should not need to write your own return functions now, <strong>just <em>__return_*</em> it</strong> instead.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpfirstaid.com/2012/04/just-return-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tri-Account Security</title>
		<link>http://wpfirstaid.com/2012/03/tri-account-security/</link>
		<comments>http://wpfirstaid.com/2012/03/tri-account-security/#comments</comments>
		<pubDate>Fri, 16 Mar 2012 16:40:02 +0000</pubDate>
		<dc:creator>The Doctor</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[accounts]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://wpfirstaid.com/?p=1147</guid>
		<description><![CDATA[Tri-Account Security and protecting your self-hosted WordPress installation.]]></description>
			<content:encoded><![CDATA[<p>I seem to keep coming across various and sundry tweets, posts, and other references to security issues and attempts to &#8220;brute-force&#8221; access to self-hosted <a title="WordPress-dot-org" href="http://wordpress.org/">WordPress</a> installations. The following is something I recommend if you have any concerns &#8230; or maybe just feeling a bit paranoid.</p>
<p>I call it Tri-Account Security ™. The idea is actually very simple and quite easy to implement. All it really requires is forming the habit of using three (3) separate accounts, each with their own specific purposes.</p>
<p>Let me break them down for you:</p>
<ol>
<li>The Primary Administrator</li>
<li>The Primary Editor</li>
<li>The Primary Contributor</li>
</ol>
<p><div class="aside-toggler open"><span class="open-aside note">To see the <em>Note</em> click here.</span><span class="close-aside note">To hide the <em>Note</em> click here.</span>
                         </div><div class="bnsia aside note open">NB: You will need three (3) email addresses for this &#8230; remember to set them up before following this idea through.</div><script type="text/javascript">
            /* <![CDATA[ */
            jQuery( document ).ready( function(){
                jQuery( ".aside-toggler" ).click( function(){
                    jQuery( this ).toggleClass( "open" ).toggleClass( "closed" ).next( ".aside" ).slideToggle( "slow", function(){
                        jQuery( this ).toggleClass( "open" ).toggleClass( "closed" );
                    });
                });
            });
            /* ]]&gt; */
            </script><br />
Actually you can have as many contributor accounts as you like with this system, but you should have at least one for this to work best. Let me explain how I recommend using these accounts.</p>
<p>The first account, <em>The Primary Administrator</em>, is the installation account. This account is just for the purpose of doing the installation. This account is also the one to use for upgrading; adding new themes; or, adding new plugins. Make the name relatively obscure; and, make the password very, very strong (not too strong to forget, but very difficult to guess &#8230; by human or machine). Also, never post with this account &#8230; ever!</p>
<p>The second account, <em>The Primary Editor</em>, is your publishing account. I would suggest a more common user name with a strong password; this account will be used to actually post content to your site. Although you shouldn&#8217;t normally need to actually post with the account it&#8217;s generally fine to do so.</p>
<p>The third account, <em>The Primary Contributor</em>, is your public facing account. Use a simple username, one that makes sense to see in the post meta details, such as the commonly used &#8220;posted by &#8230;&#8221; text. Also note this username, like all usernames in a default installation will appear as part of the author URL in a browser&#8217;s address bar. The password for this account can be simple, but should still be &#8220;strong&#8221; &#8230; but if someone breaks into it they really will not have that much access to anything so you can feel secure in making it very easy to remember.</p>
<p>Aside from the &#8220;strength&#8221; of the passwords recommended for each account above, I will not be going any further into their creation in this post (but maybe I&#8217;ll write one down the road) except to make one final suggestion for creating a strong password: use an appropriate amount of common words, or phrase, (without spaces) perhaps five (5) for the Administrator, four (4) for the Editor, and three (3) for the Contributor.</p>
<p>Now that we have the three accounts with a basic premise for each set out, let&#8217;s have a look at actually putting them to use in a couple of examples.</p>
<p><span style="text-decoration: underline;">Example 1</span></p>
<p>Log in with your Contributor account and write the greatest post ever written &#8230; no really, go for it! I&#8217;ll wait &#8230;</p>
<p>OK, now that we have the post written, and you have clicked the &#8220;Submit for Review&#8221; button (notice how it does not say &#8220;Publish&#8221;); log out and log back in with your Editor account. Once logged in with your editor account, navigate to the <strong>Posts &gt; All Posts</strong> Administration Panel and locate your greatest post ever (it should be at or near the top of the list, remember it&#8217;s great; you would expect it to be lost at the bottom of the page?!)</p>
<p>Now either using &#8220;Edit&#8221; or &#8220;Quick Edit&#8221; you can change the post from &#8220;pending review&#8221; to &#8220;published&#8221;&#8230; and now the greatest post ever written is available for the world of the Internet to read. Congratulations!</p>
<p>You may also notice the only author information readily available will be your <em>Contributor</em> ID; or in other words, your pen name &#8230; and therefore protecting the identity of both your <em>Administrator</em> account and your <em>Editor</em> account.</p>
<p><span style="text-decoration: underline;">Example 2</span></p>
<p>You are about to write the second greatest post ever written (you did follow Example 1, right?) but notice there is an update that needs to be addressed. As a <em>Contributor</em> you really have no control whatsoever over the WordPress installation, its management, or its administration.</p>
<p>Oh, administration &#8230; we have an account for that. Simply log out of your <em>Contributor</em> (or <em>Editor</em>) account, and log back in with your <em>Administrator</em> account. Perform any updates and/or maintenance. Log out. Done!</p>
<p>Now, log back into your <em>Contributor</em> account and get back to writing the second greatest post ever written &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://wpfirstaid.com/2012/03/tri-account-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add A Custom Font</title>
		<link>http://wpfirstaid.com/2012/02/add-a-custom-font/</link>
		<comments>http://wpfirstaid.com/2012/02/add-a-custom-font/#comments</comments>
		<pubDate>Mon, 27 Feb 2012 16:40:42 +0000</pubDate>
		<dc:creator>The Doctor</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Typography]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[how-to]]></category>

		<guid isPermaLink="false">http://wpfirstaid.com/?p=1134</guid>
		<description><![CDATA[Using @font-face and a bit of CSS to add a custom font]]></description>
			<content:encoded><![CDATA[<p>Using @font-face &#8230;</p>
<ol>
<li>Find the font you like</li>
<li>Make sure the font license allows you to use it!</li>
<li>Upload the font to your site / include with your theme package.</li>
<li>Write the CSS.</li>
</ol>
<p>OK &#8230; that seems simple enough, four relatively easy steps to follow. Let&#8217;s give it a run.</p>
<p>Step 1, I went to <a href="http://www.google.com/webfonts#HomePlace:home" title="Google Web Fonts">Google Web Fonts</a> and browsed for something I liked; I chose &#8220;Glass Antiqua&#8221; by <a href="https://plus.google.com/106558435145097149719/about" title="Google+ Denis Masharov">Denis Masharov</a><sup>1</sup>.</p>
<p>Step 2, the font is licensed under the <a href="http://scripts.sil.org/OFL" title="SIL Open Font License">SIL Open Font License, Version 1.1</a>, which is compatible with the <a href="http://www.gnu.org/licenses/gpl-2.0.html" title="GNU GPLv2 License">GNU GPLv2 License</a> (something I strive to release all projects under).</p>
<p>Step 3, I uploaded the font <strong>and license text</strong> to my current theme&#8217;s font folder.</p>
<p>Step 4, I made the necessary CSS modifications to, in this case, change the site&#8217;s title font.</p>
<pre class="brush: plain; title: ; notranslate">
@font-face {
  font-family: 'Glass Antiqua';
  src: url('fonts/GlassAntiqua-Regular.ttf') format('truetype');
}

#blog-title {
  /* font-family: &quot;Copperplate Gothic Bold&quot;, Arial, sans-serif; */
  /* font-size: 30px; */
  font-family: &quot;Glass Antiqua&quot;, cursive;
  font-size: 70px;
  ...
</pre>
<p>&#8230; and with a tweak to the `font-size` value, we&#8217;re done!</p>
<p>Very easy, and points for not having to worry about being behind a firewall, intranet or local test environment as this method will work in those cases as well.</p>
<div class="aside-toggler open"><span class="open-aside footnotes">To see the <em>footnotes</em> click here.</span><span class="close-aside footnotes">To hide the <em>footnotes</em> click here.</span>
                         </div><div class="bnsia aside footnotes open">Footnotes:<br />
1. Please note the original design for Glass Antiqua, as noted by Denis Masharov, should be accredited to <a href="https://www.google.com/search?q=Franz+Paul+Glass" title="Google Search: Franz Paul Glass">Franz Paul Glass</a>. The Doctor<br />
</div>
]]></content:encoded>
			<wfw:commentRss>http://wpfirstaid.com/2012/02/add-a-custom-font/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove Comment Form Website Section</title>
		<link>http://wpfirstaid.com/2012/01/remove-comment-form-website-section/</link>
		<comments>http://wpfirstaid.com/2012/01/remove-comment-form-website-section/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 16:47:01 +0000</pubDate>
		<dc:creator>The Doctor</dc:creator>
				<category><![CDATA[Functions]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[add_filter]]></category>
		<category><![CDATA[comment_form]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://wpfirstaid.com/?p=1122</guid>
		<description><![CDATA[From time to time an interesting Five-Minute-FixTM comes along that sparks a great reason to add another WordPress Tips post. The idea for this tip started with this comment at BuyNowShop.com: &#8230; how to remove the website section when leaving a reply/comment &#8230; The solution may be obvious to some and can be readily derived [...]]]></description>
			<content:encoded><![CDATA[<p>From time to time an interesting <a href="http://buynowshop.com/five-minute-fix/" title="Five Minute Fix @ BuyNowShop">Five-Minute-Fix<sup>TM</sup></a> comes along that sparks a great reason to add another <a href="http://wpfirstaid.com/category/tips/" title="WPFirstAid WordPress Tips">WordPress Tips</a> post. The idea for this tip started with <a href="http://buynowshop.com/five-minute-fix/comment-page-1/#comment-11155">this comment</a> at <a href="http://buynowshop.com/" title="BuyNowShop.com">BuyNowShop.com</a>:</p>
<blockquote><p>&#8230; how to remove the website section when leaving a reply/comment &#8230;</p></blockquote>
<p>The solution may be obvious to some and can be readily derived from the information found on the WordPress codex page for the `<a href="http://codex.wordpress.org/Function_Reference/comment_form" title="Codex: comment_form">comment_form</a>` function, but if you are new to <a href="http://wordpress.org/" title="WordPress-dot-org">WordPress</a> and/or not familiar with writing a function to use with `<a href="http://codex.wordpress.org/Function_Reference/add_filter" title="Codex: add_filter">add_filter</a>`, here is a very simple and working snippet to use in your theme:</p>
<div class="aside-toggler open"><span class="open-aside tip">To see the <em>tip</em> click here.</span><span class="close-aside tip">To hide the <em>tip</em> click here.</span>
                         </div><div class="bnsia aside tip open">
<pre class="brush: php; title: ; notranslate">
function wpfa_remove_comment_website_section(){
    $commenter = wp_get_current_commenter();
    $req = get_option( 'require_name_email' );
    $aria_req = ( $req ? &quot; aria-required='true'&quot; : '' );
    $fields =  array(
        'author' =&gt; '&lt;p class=&quot;comment-form-author&quot;&gt;' . '&lt;label for=&quot;author&quot;&gt;' . __( 'Name' ) . '&lt;/label&gt; ' . ( $req ? '&lt;span class=&quot;required&quot;&gt;*&lt;/span&gt;' : '' ) .
                    '&lt;input id=&quot;author&quot; name=&quot;author&quot; type=&quot;text&quot; value=&quot;' . esc_attr( $commenter['comment_author'] ) . '&quot; size=&quot;30&quot;' . $aria_req . ' /&gt;&lt;/p&gt;',
        'email'  =&gt; '&lt;p class=&quot;comment-form-email&quot;&gt;&lt;label for=&quot;email&quot;&gt;' . __( 'Email' ) . '&lt;/label&gt; ' . ( $req ? '&lt;span class=&quot;required&quot;&gt;*&lt;/span&gt;' : '' ) .
                    '&lt;input id=&quot;email&quot; name=&quot;email&quot; type=&quot;text&quot; value=&quot;' . esc_attr(  $commenter['comment_author_email'] ) . '&quot; size=&quot;30&quot;' . $aria_req . ' /&gt;&lt;/p&gt;',
        'url'    =&gt; '' /** removes website section */,
    );
    return $fields;
}
add_filter( 'comment_form_default_fields', 'wpfa_remove_comment_website_section' );
</pre>
<p></div>
<p>Ideally, this will be placed in the &#8216;functions.php&#8217; file of your theme, but better yet this should be included in the <a href="http://wpfirstaid.com/2011/04/wordpress-child-themes/" title="WordPress Child-Themes">Child-Theme</a> you created of the theme you want to modify.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpfirstaid.com/2012/01/remove-comment-form-website-section/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>No-Title Sticky Post-Format Posts?!</title>
		<link>http://wpfirstaid.com/2011/12/no-title-sticky-post-format-posts/</link>
		<comments>http://wpfirstaid.com/2011/12/no-title-sticky-post-format-posts/#comments</comments>
		<pubDate>Fri, 09 Dec 2011 21:28:28 +0000</pubDate>
		<dc:creator>The Doctor</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[add_theme_support]]></category>
		<category><![CDATA[post-formats]]></category>
		<category><![CDATA[post_class]]></category>
		<category><![CDATA[sticky posts]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://wpfirstaid.com/?p=1098</guid>
		<description><![CDATA[Making sure to test all of the combinations these three items can create.]]></description>
			<content:encoded><![CDATA[<p>Say what?! Seriously?</p>
<p>Yes, seriously. Although this sort of thing is not too likely to exist in the wild here are a few tips and idea to keep in mind when developing a theme.</p>
<p>Let&#8217;s start from the end with <em>&#8216;post-format&#8217;</em> posts and work our way back to the beginning. It wasn&#8217;t all that long ago WordPress introduced default post-formats that could be easily added to themes. Here&#8217;s a one-liner to put in your functions.php file that does it all, well it&#8217;s a good <a href="http://codex.wordpress.org/Post_Formats#Adding_Theme_Support" title="Add Theme Support for Post Formats">example from the codex</a> showing two post-formats:</p>
<pre class="brush: plain; title: ; notranslate">add_theme_support( 'post-formats', array( 'aside', 'gallery' ) )</pre>
<div class="aside-toggler closed"><span class="open-aside post-formats">To read more about Post Formats, click here</span><span class="close-aside post-formats">To hide the <em>Post Formats</em> click here.</span>
                         </div><div class="bnsia aside post-formats closed">There are nine (9) default <em>&#8216;post-formats&#8217;</em> as of this writing; there may be more added in the future but these work well. The number of ways end-users might use them is not much less than the ideas they can imagine.</p>
<p>Following is the complete &#8220;supported&#8221; list. You can <a href="http://codex.wordpress.org/Post_Formats#Supported_Formats" title="Supported Post Formats">visit the codex</a> for what some might consider their recommended usages.</p>
<ul>
<li>aside</li>
<li>gallery</li>
<li>link</li>
<li>image</li>
<li>quote</li>
<li>status</li>
<li>video</li>
<li>audio</li>
<li>chat</li>
</ul>
<p></div>
<p>Post-formats have been around since WordPress <a href="http://codex.wordpress.org/Version_3.1">Version 3.1</a>, if you are not familiar with them yet you should go back and read more about them.</p>
<p>Our next step back is to <a href="http://codex.wordpress.org/Sticky_Posts" title="Sticky Posts">Sticky Posts</a> introduced back in <a href="http://codex.wordpress.org/Version_2.7">version 2.7</a>. If you are not familiar with sticky posts then definitely take a few moments to read the articles linked to &#8230; I can wait.</p>
<p>So far, so good &#8230; right? Good!</p>
<p>Now let&#8217;s get to the beginning of the post title: No-Title; and, yes, this is something that should be addressed when developing a theme. <a href="http://en.wikipedia.org/wiki/The_Shadow" title="obligatory obscure reference ... read Wikipedia article: The Shadow" target="_blank">The Shadow</a> knows &#8230; otherwise one may never know the imagination of the end-user, or if their personal taste demands one (or many) posts are published without a title. Generally speaking, each of these items are handled well enough on their own but what happens when you combine them? If you have thoroughly tested your theme then most any combination of these elements should have been easily and clearly addressed; most of which can be done with simple CSS, too.</p>
<p>The key CSS elements to address for these items are the following:</p>
<ul>
<li>.format-aside</li>
<li>.format-gallery</li>
<li>.format-< post-format > &#8211; substitute < post-format > with the appropriate term</li>
<li>.sticky</li>
</ul>
<p>There may, or may not, be a theme CSS element used for a post without a title but that is well beyond the scope of this post; just remember to test each <em>&#8216;post-format&#8217;</em> with and without a title.</p>
<p>Now last, but not least, the simple CSS element to remember for the final testing: <em>&#8216;.format-< post-format >.sticky&#8217;</em> &#8230; again substituting the <em>< post-format ></em> for *all* of the <em>&#8216;post-formats&#8217;</em> used in the theme. Note there is no space between, for example, <em>.format-aside</em> and <em>.sticky</em> the element would be: <em>.format-aside.sticky</em> &#8230; these elements are automatically generated by WordPress if the theme uses the `<em><a href="http://codex.wordpress.org/Function_Reference/post_class" title="post_class function" target="_blank">post_class</a></em>` function correctly.</p>
<p>Granted this was a bit long written but hopefully helpful. It&#8217;s just something I found that required a lot more to properly address than what I first suspected as I was updating my theme <a href="http://buynowshop.com/themes/desk-mess-mirrored/" title="Desk Mess Mirrored" target="_blank">Desk Mess Mirrored</a> to version 2.0.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpfirstaid.com/2011/12/no-title-sticky-post-format-posts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Filtering WP Title</title>
		<link>http://wpfirstaid.com/2011/11/filtering-wp-title/</link>
		<comments>http://wpfirstaid.com/2011/11/filtering-wp-title/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 20:19:36 +0000</pubDate>
		<dc:creator>The Doctor</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[add_filter]]></category>
		<category><![CDATA[get_bloginfo]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[is_frontpage]]></category>
		<category><![CDATA[is_home]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wp_title]]></category>

		<guid isPermaLink="false">http://wpfirstaid.com/?p=1087</guid>
		<description><![CDATA[A recent recommendation, starting with WordPress 3.3, from the WordPress Theme Review Team reads: Themes are REQUIRED to use wp_title filter to filter wp_title() (RECOMMENDED), or pass argument to wp_title() (OPTIONALLY), in order to modify document title content This has been discussed, worked through, and for the most part sorted out &#8230; but there doesn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>A recent recommendation, starting with WordPress 3.3, <a href="http://make.wordpress.org/themes/2011/11/10/wordpress-3-3-proposed-guidelines-revisions/" title="WordPress 3.3 Proposed Guidelines Revisions">from the WordPress Theme Review Team</a> reads:</p>
<blockquote><p>Themes are REQUIRED to use wp_title filter to filter wp_title() (RECOMMENDED), or pass argument to wp_title() (OPTIONALLY), in order to modify document title content</p></blockquote>
<p>This has been discussed, worked through, and for the most part sorted out &#8230; but there doesn&#8217;t appear to be any sort of example code to work from. This presented an opportunity to have a look around the <a href="http://codex.wordpress.org/Main_Page" title="WordPress Codex">WordPress codex</a> and the source code for some ideas how to filter the `<a href="http://codex.wordpress.org/Plugin_API/Filter_Reference/wp_title" title="Plugin API/Filter Reference/wp title">wp_title</a>` function.</p>
<p>Essentially, the idea behind the code (below) is to take a basic function call of `<a href="http://codex.wordpress.org/Function_Reference/wp_title" title="Function Reference/wp title">wp_title</a>` add some relevant text (a la default themes: <a href="http://wordpress.org/extend/themes/twentyten" title="WordPress Twenty Ten Theme">Twenty Ten</a> / <a href="http://wordpress.org/extend/themes/twentyeleven" title="WordPress Twenty Eleven Theme">Twenty Eleven</a>) then filter it back into the function; and finally to echo this to the HTML &lt;title&gt; tag.</p>
<div class="aside-toggler closed"><span class="open-aside wpfa-wp-title-code">To see the <em>WPFA WP Title code</em> click here.</span><span class="close-aside wpfa-wp-title-code">To hide the <em>WPFA WP Title code</em> click here.</span>
                         </div><div class="bnsia aside wpfa-wp-title-code closed">
<pre class="brush: php; title: ; notranslate">&lt;?php
if ( ! function_exists( 'wpfa_wp_title' ) ) {
    /**
* WPFA WP Title
*
* Utilizes the `wp_title` filter to add text to the default output
*
* @package WPFA_WP_Title
* @version 0.2 - last revised April 26, 2012
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/wp_title
* @link https://gist.github.com/1410493
*
* @param string $old_title - default title text
* @param string $sep - separator character
* @param string $sep_location - left|right - separator placement in relationship to title
*
* @return string - new title text
*/
    function wpfa_wp_title( $old_title, $sep, $sep_location ) {
        global $page, $paged;
        /** Set initial title text */
        $wpfa_title_text = $old_title . get_bloginfo( 'name' );
        /** Add wrapping spaces to separator character */
        $sep = ' ' . $sep . ' ';

        /** Add the blog description (tagline) for the home/front page */
        $site_tagline = get_bloginfo( 'description', 'display' );
        if ( $site_tagline &amp;&amp; ( is_home() || is_front_page() ) )
            $wpfa_title_text .= &quot;$sep$site_tagline&quot;;

        /** Add a page number if necessary */
        if ( $paged &gt;= 2 || $page &gt;= 2 )
            $wpfa_title_text .= $sep . sprintf( __( 'Page %s', 'wpfa-wp-title-textdomain' ), max( $paged, $page ) );

        return $wpfa_title_text;
    }
}
add_filter( 'wp_title', 'wpfa_wp_title', 10, 3 ); ?&gt;
</pre>
<p></div>
<p>Hopefully this will be useful, or maybe it will not &#8230; but it will be found in the next release of Desk Mess Mirrored as that is the theme where I first wrote and tested it with.</p>
<p>Enjoy!</p>
<div class="aside-toggler open"><span class="open-aside note">To see the <em>note</em> click here.</span><span class="close-aside note">To hide the <em>note</em> click here.</span>
                         </div><div class="bnsia aside note open">PS: Note the <a href="https://gist.github.com/1410493" title="WPFA WP Title - github:gist">github:gist link</a> in the code sample &#8230; feel free to download it from there, as well as copying it from here. The Doctor.</div>
<div class="aside-toggler open"><span class="open-aside note">To see the <em>note</em> click here.</span><span class="close-aside note">To hide the <em>note</em> click here.</span>
                         </div><div class="bnsia aside note open">Code example revised April 26, 2012 to more correctly use the `wp_title` filter. Also to note, this method now expects the theme to simply call <a href="http://codex.wordpress.org/Plugin_API/Filter_Reference/wp_title" title="Plugin API/Filter Reference/wp title">wp_title()</a> in the &#8216;header.php&#8217; template. The Doctor.</div>
]]></content:encoded>
			<wfw:commentRss>http://wpfirstaid.com/2011/11/filtering-wp-title/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enqueue Plugin Custom Stylesheet</title>
		<link>http://wpfirstaid.com/2011/11/enqueue-plugin-custom-stylesheet/</link>
		<comments>http://wpfirstaid.com/2011/11/enqueue-plugin-custom-stylesheet/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 20:46:25 +0000</pubDate>
		<dc:creator>The Doctor</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[add_action]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[is_readable]]></category>
		<category><![CDATA[plugin_dir_path]]></category>
		<category><![CDATA[plugin_dir_url]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wp_enqueue_scripts]]></category>
		<category><![CDATA[wp_enqueue_styles]]></category>

		<guid isPermaLink="false">http://wpfirstaid.com/?p=1072</guid>
		<description><![CDATA[Now that is a bit of a handful to grab onto &#8230; but the code and concept is relatively straight forward and easy to implement. As I was recently updating some of my plugins in preparation for WordPress 3.3 I decided to better implement the style elements being used in these plugins. The current best-practice [...]]]></description>
			<content:encoded><![CDATA[<p>Now that is a bit of a handful to grab onto &#8230; but the code and concept is relatively straight forward and easy to implement.</p>
<p>As I was recently updating some of my plugins in preparation for WordPress 3.3 I decided to better implement the style elements being used in these plugins. The current best-practice methods point to using the `wp_enqueue_scripts` hook with the `wp_enqueue_styles` function. Let&#8217;s get our eyes on a snippet for this:</p>
<pre class="brush: php; title: ; notranslate">function WPFA_Styles() {
        wp_enqueue_style( 'WPFA-Plugin-Style', plugin_dir_url( __FILE__ ) . 'wpfa-plugin-style.css', array(), '0.1', 'screen' );
}
add_action( 'wp_enqueue_scripts', 'WPFA_Styles' );</pre>
<p>We create a function to enqueue our stylesheet; then we use `add_action` to hook into `wp_enqueue_scripts` and we&#8217;re done &#8230; or are we?</p>
<p>What if we wanted to let the end-user add their own styles to the plugin CSS elements but not have them over-written with the next plugin update? Easy, just add another `wp_enqueue_style` into the `WP_Styles` function like this:</p>
<pre class="brush: php; title: ; notranslate">function WPFA_Styles() {
        wp_enqueue_style( 'WPFA-Plugin-Style', plugin_dir_url( __FILE__ ) . 'wpfa-plugin-style.css', array(), '0.1', 'screen' );
        wp_enqueue_style( 'WPFA-Plugin-Custom-Style', plugin_dir_url( __FILE__ ) . 'wpfa-plugin-custom-style.css', array(), '0.1', 'screen' );
}
add_action( 'wp_enqueue_scripts', 'WPFA_Styles' );</pre>
<p>This is fine, but what if the custom stylesheet does not exist? Although it will not cause any significant issues there is no reason to actually enqueue a file that does not exist. The solution to this is straight forward as well, just check if the file is available to be used &#8230; but how?</p>
<p>Let&#8217;s look at the complete example to see where I add the `is_readable` conditional check:</p>
<pre class="brush: php; title: ; notranslate">/**
 * Enqueue Plugin Styles
 *
 * Adds plugin stylesheet and allows for additional custom stylesheet to be added by end-user. Custom stylesheet is only enqueued if it is available to be used.
 * 
 * @package     WPFA_Styles
 * @link        http://wpfirstaid.com/2011/11/enqueue-plugin-custom-stylesheet/
 * @version     0.1
 * @author      Edward Caissie &lt;thedoctor@wpfirstaid.com&gt; 
 * @copyright   Copyright (c) 2010-2011, Edward Caissie
 * 
 * @internal    Note: all stylesheets enqueued in this manner are expected to be in the root folder of the plugin.  
 */
function WPFA_Styles() {
        /** Enqueue Style Sheets */
        wp_enqueue_style( 'WPFA-Plugin-Style', plugin_dir_url( __FILE__ ) . 'wpfa-plugin-style.css', array(), '0.1', 'screen' );
        // Only enqueue if available
        if ( is_readable( plugin_dir_path( __FILE__ ) . 'wpfa-plugin-custom-style.css' ) ) {
            wp_enqueue_style( 'WPFA-Plugin-Custom-Style', plugin_dir_url( __FILE__ ) . 'wpfa-plugin-custom-style.css', array(), '0.1', 'screen' );
        }
}
add_action( 'wp_enqueue_scripts', 'WPFA_Styles' );</pre>
<p>Note the use of `plugin_dir_path` in the conditional check, this is key as the `is_readable` function requires the path and will not work using the URL.</p>
<p>This may appear as a <a href="http://edwardcaissie.com/2010/08/mallory-everest-ideas/">Mallory-Everest idea</a>, but there have been use-cases where an additional custom stylesheet solved the issues at hand. Hopefully this will be of use to you.</p>
<p><div class="aside-toggler closed"><span class="open-aside wordpress-codex-references">To see the <em>WordPress Codex References</em> click here.</span><span class="close-aside wordpress-codex-references">To hide the <em>WordPress Codex References</em> click here.</span>
                         </div><div class="bnsia aside wordpress-codex-references closed"><br />
add_action &#8211; <a href="http://codex.wordpress.org/Function_Reference/add_action">http://codex.wordpress.org/Function_Reference/add_action</a><br />
plugin_dir_path &#8211; <a href="http://codex.wordpress.org/Function_Reference/plugin_dir_path">http://codex.wordpress.org/Function_Reference/plugin_dir_path</a><br />
plugin_dir_url &#8211; <a href="http://codex.wordpress.org/Function_Reference/plugin_dir_url">http://codex.wordpress.org/Function_Reference/plugin_dir_url</a><br />
wp_enqueue_scripts &#8211; <a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_script">http://codex.wordpress.org/Function_Reference/wp_enqueue_script</a><br />
wp_enqueue_styles &#8211; <a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_styles">http://codex.wordpress.org/Function_Reference/wp_enqueue_styles</a><br />
</div><br />
<div class="aside-toggler closed"><span class="open-aside php-functions">To see the <em>PHP Functions</em> click here.</span><span class="close-aside php-functions">To hide the <em>PHP Functions</em> click here.</span>
                         </div><div class="bnsia aside php-functions closed"><br />
is_readable &#8211; <a href="http://www.php.net/manual/en/function.is-readable.php">http://www.php.net/manual/en/function.is-readable.php</a><br />
</div></p>
]]></content:encoded>
			<wfw:commentRss>http://wpfirstaid.com/2011/11/enqueue-plugin-custom-stylesheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Start Using WordPress Beta</title>
		<link>http://wpfirstaid.com/2011/10/start-using-wordpress-beta/</link>
		<comments>http://wpfirstaid.com/2011/10/start-using-wordpress-beta/#comments</comments>
		<pubDate>Wed, 12 Oct 2011 15:20:15 +0000</pubDate>
		<dc:creator>The Doctor</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://wpfirstaid.com/?p=1060</guid>
		<description><![CDATA[The basics, as a general guideline, on how to start using the latest WordPress beta version.]]></description>
			<content:encoded><![CDATA[<p>Just as I have been doing for the last several versions I will be updating to run the most recent version of the WordPress beta (version 3.3-beta1 as of this writing) live on this site as well as all of the other domains I own where WordPress is installed.</p>
<p>Although I have complete confidence in the stability of the beta versions I would still only suggest / recommend this practice to those with a reasonable knowledge of PHP and the ability to recover from any potential catastrophic disaster (read: BACK-UP everything first!!!).</p>
<p>Here are the basics, as each version changes these may not be exactly the same but should still serve as a general guideline:</p>
<ol>
<li>Back up your WordPress installation (all of it).</li>
<li>Using your preferred text editor, open the /wp-includes/version.php file in core to edit.</li>
<li>Find and change <em>$wp_version</em> to a &#8216;point value&#8217; greater than the current version, for example: 3.4-alpha.</li>
<li>Go to your the Administration Panels (&#8220;Dashboard&#8221;) of your WordPress installation.</li>
<li>Scroll to the bottom of the page and click on the “stay updated” link in the bottom-right corner. (Refresh the page if the link is not there.)</li>
<li>Follow any additional prompts, such as updating the database, etc.</li>
</ol>
<p>You should now be running the latest version of &#8216;trunk&#8217;.</p>
<p>Of course there is a widely used plugin (<a title="Plugin: WordPress Beta Tester" href="http://wordpress.org/extend/plugins/wordpress-beta-tester/">WordPress Beta Tester</a>) by <a title="Peter Westwood" href="http://profiles.wordpress.org/users/westi/">Westi</a> that does most if not all of the above for you &#8230; I just like to do this manually.</p>
<div class="aside-toggler open"><span class="open-aside note">To see the <em>Note</em> click here.</span><span class="close-aside note">To hide the <em>Note</em> click here.</span>
                         </div><div class="bnsia aside note open">NB: Updated to reflect WordPress version 3.4 beta is now available.</div>
]]></content:encoded>
			<wfw:commentRss>http://wpfirstaid.com/2011/10/start-using-wordpress-beta/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Do Not Display Comments HTML Tags</title>
		<link>http://wpfirstaid.com/2011/08/do-not-display-comments-html-tags/</link>
		<comments>http://wpfirstaid.com/2011/08/do-not-display-comments-html-tags/#comments</comments>
		<pubDate>Sun, 07 Aug 2011 22:24:54 +0000</pubDate>
		<dc:creator>The Doctor</dc:creator>
				<category><![CDATA[Functions]]></category>
		<category><![CDATA[comment_form]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://wpfirstaid.com/?p=1052</guid>
		<description><![CDATA[A standard function found in many themes is the comment_form. This is a core function of WordPress that produces a standard comment form generally consisting of text fields for the name and email address and a textarea for the actual comment. You will also find there are some standard text outputs produced by this function [...]]]></description>
			<content:encoded><![CDATA[<p>A standard function found in many themes is the <em>comment_form</em>. This is a <a href="http://codex.wordpress.org/Function_Reference/comment_form" title="Codex: comment_form">core function</a> of <a href="http://wordpress.org" title="WordPress">WordPress</a> that produces a standard comment form generally consisting of text fields for the name and email address and a textarea for the actual comment. You will also find there are some standard text outputs produced by this function as well, one of those is the allowed HTML tags that can be used in the form.</p>
<pre>You may use these HTML tags and attributes: &lt;a href="" title=""> &lt;abbr title=""> &lt;acronym title=""> &lt;b> &lt;blockquote cite=""> &lt;cite> &lt;code> &lt;del datetime=""> &lt;em> &lt;i> &lt;q cite=""> &lt;strike> &lt;strong></pre>
<p>If you do not want to display this text it is actually very easy to do. It can be done with a line of CSS or a minor edit to the theme in question. The following is based on using the comment_form function in its default state:</p>
<pre class="brush: php; title: ; notranslate">&lt;?php comment_form(); ?&gt;</pre>
<p>To hide the message above with CSS, add one of the following to the end of your style.css file:</p>
<pre class="brush: css; title: ; notranslate">p.form-allowed-tags { display: none; }</pre>
<pre class="brush: css; title: ; notranslate">p.form-allowed-tags { visibility: hidden; }</pre>
<p>Using the display property &#8220;removes&#8221; the block of text whereas using the visibility property simply &#8220;hides&#8221; the text leaving the block being filled with nothing. Which method is best will be more due to aesthetics than anything else.</p>
<p>If you want to edit your theme files, look into the comments.php template file (again a standard default naming convention, your theme may vary), and find the default code noted above and change it to the following:</p>
<pre class="brush: php; title: ; notranslate">&lt;?php comment_form( 'comment_notes_after=' ); ?&gt;</pre>
<p>Always remember, any edits you make to the theme may be over-written with the theme&#8217;s next update &#8230; always back-up your work.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpfirstaid.com/2011/08/do-not-display-comments-html-tags/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Dynamic Copyright Revisited</title>
		<link>http://wpfirstaid.com/2011/06/dynamic-copyright-revisited/</link>
		<comments>http://wpfirstaid.com/2011/06/dynamic-copyright-revisited/#comments</comments>
		<pubDate>Mon, 13 Jun 2011 16:55:50 +0000</pubDate>
		<dc:creator>The Doctor</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[apply_filters]]></category>
		<category><![CDATA[bns_dynamic_copyright]]></category>
		<category><![CDATA[dynamic_copyright]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://wpfirstaid.com/?p=1031</guid>
		<description><![CDATA[An updated version of the dynamic copyright function found in BuyNowShop.com themes by Cais.]]></description>
			<content:encoded><![CDATA[<p>A while back I wrote an article about a function to generate a <a title="Dynamic Copyright" href="http://wpfirstaid.com/2010/02/dynamic-copyright/">dynamic copyright</a> to display in themes.  Although I imagine the function can be adapted to be used elsewhere, the original intent was to place the function call in the footer of any given theme.</p>
<p>The function itself can be found in all the themes currently available from <a title="Cais' Profile at WordPress.org" href="http://profiles.wordpress.org/users/cais">Cais</a> at <a title="BuyNowShop.com" href="http://buynowshop.com">BuyNowShop.com</a> via the <a title="WordPress" href="http://wordpress.org">WordPress</a> Extend <a title="WordPress Extend Themes repository" href="http://wordpress.org/extend/themes/">Themes repository</a>. There have been a few minor changes to the function since it was introduced; and, it is just recently undergoing much more dramatic changes.</p>
<p>That being the case, I thought this would be a great opportunity to revisit the function and discuss what has changed since the last time I wrote about it here.</p>
<div class="aside-toggler closed"><span class="open-aside bns-dynamic-copyright-code">To see the <em>BNS Dynamic Copyright code</em> click here.</span><span class="close-aside bns-dynamic-copyright-code">To hide the <em>BNS Dynamic Copyright code</em> click here.</span>
                         </div><div class="bnsia aside bns-dynamic-copyright-code closed"></p>
<pre class="brush: php; title: ; notranslate">// Start BNS Dynamic Copyright
if ( ! function_exists( 'bns_dynamic_copyright' ) ) {
  function bns_dynamic_copyright( $args = '' ) {
      $initialize_values = array( 'start' =&gt; '', 'copy_years' =&gt; '', 'url' =&gt; '', 'end' =&gt; '' );
      $args = wp_parse_args( $args, $initialize_values );

      /* Initialize the output variable to empty */
      $output = '';

      /* Start common copyright notice */
      empty( $args['start'] ) ? $output .= sprintf( __('Copyright') ) : $output .= $args['start'];

      /* Calculate Copyright Years; and, prefix with Copyright Symbol */
      if ( empty( $args['copy_years'] ) ) {
        /* 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;

        /* First post year versus current year */
        $first_year = substr( $first_date, 0, 4 );
        if ( $first_year == '' ) {
          $first_year = date( 'Y' );
        }

      /* Add to output string */
        if ( $first_year == date( 'Y' ) ) {
        /* Only use current year if no posts in previous years */
          $output .= ' &amp;copy; ' . date( 'Y' );
        } else {
          $output .= ' &amp;copy; ' . $first_year . &quot;-&quot; . date( 'Y' );
        }
      } else {
        $output .= ' &amp;copy; ' . $args['copy_years'];
      }

      /* Create URL to link back to home of website */
      empty( $args['url'] ) ? $output .= ' &lt;a href=&quot;' . home_url( '/' ) . '&quot; title=&quot;' . esc_attr( get_bloginfo( 'name', 'display' ) ) . '&quot; rel=&quot;home&quot;&gt;' . get_bloginfo( 'name', 'display' ) .'&lt;/a&gt;  ' : $output .= ' ' . $args['url'];

      /* End common copyright notice */
      empty( $args['end'] ) ? $output .= ' ' . sprintf( __('All rights reserved.') ) : $output .= ' ' . $args['end'];

      /* Construct and sprintf the copyright notice */
      $output = sprintf( __('&lt;span id=&quot;bns-dynamic-copyright&quot;&gt; %1$s &lt;/span&gt;&lt;!-- #bns-dynamic-copyright --&gt;'), $output );
      $output = apply_filters( 'bns_dynamic_copyright', $output, $args );

      echo $output;
  }
}
// End BNS Dynamic Copyright
</pre>
<p></div>
<p>What&#8217;s changed:</p>
<ol>
<li>A `function_exists` conditional check has been added</li>
<li>Better internationalization string formating has been applied.</li>
<li>Default arguments have been set to generate a common notice.</li>
<li>The `apply_filters` function has been implemented to allow for easier customization.</li>
</ol>
<p>Also to note, the defaults are now written slightly different than the orginal generated copyright notice structure. The following are the current defaults:</p>
<ul>
<li>&#8216;start&#8217; =&gt; &#8220;Copyright&#8221;</li>
<li>&#8216;copy_years&#8217; =&gt; the copyright symbol + the dynamically generated years with published posts</li>
<li>&#8216;url&#8217; =&gt; points to the top level domain with the web site title as anchor text</li>
<li>&#8216;end&#8217; =&gt; &#8220;All Rights Reserved.&#8221;</li>
</ul>
<p>All of these paramters are now easily customized using the common WordPress structure, for example:</p>
<pre class="brush: plain; title: ; notranslate">bns_dynamic_copyright( 'start=Mine, All Mine!&amp;end=This means you, scrapers!' );</pre>
<p>&#8230; would produce the following for this site (as of this writing):</p>
<blockquote><p>Mine, All Mine! © 2009-2011 <a title="WP First Aid" href="../" rel="home">WP First Aid</a> This means you, scrapers!</p></blockquote>
<p>Of course, the above may not be appropriate for your own website &#8230; or maybe it is.</p>
<p>All the same, feel free to implement this updated function; and, don&#8217;t forget to look for it in the next releases of themes from <a title="BuyNowShop.com" href="http://buynowshop.com">BuyNowShop.com</a></p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://wpfirstaid.com/2011/06/dynamic-copyright-revisited/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

