<?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>Justin Tadlock &#187; WordPress</title>
	<atom:link href="http://justintadlock.com/topics/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://justintadlock.com</link>
	<description>Life, Blogging, and WordPress</description>
	<lastBuildDate>Thu, 16 May 2013 00:35:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Disable Post Format UI WordPress Plugin</title>
		<link>http://justintadlock.com/archives/2013/05/15/disable-post-format-ui-wordpress-plugin</link>
		<comments>http://justintadlock.com/archives/2013/05/15/disable-post-format-ui-wordpress-plugin#comments</comments>
		<pubDate>Thu, 16 May 2013 00:35:28 +0000</pubDate>
		<dc:creator>Justin Tadlock</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Plugins]]></category>

		<guid isPermaLink="false">http://justintadlock.com/?p=5036</guid>
		<description><![CDATA[A simple plugin that disables the post format <abbr title="User Interface">UI</abbr> added in WordPress 3.6.]]></description>
				<content:encoded><![CDATA[<p>And, for the simplest plugin I&#8217;ve ever created (it&#8217;s a one-liner), I introduce Disable Post Format <abbr title="User Interface">UI</abbr>.</p>
<p>I love that WordPress is all about the <em>decisions over options</em> mantra, but that sometimes means some users get stuck with stuff they don&#8217;t want.  I figured there&#8217;s probably plenty of folks who aren&#8217;t that interested in post formats, so I made a quick plugin to disable the post format <abbr title="User Interface">UI</abbr> being introduced in WordPress 3.6.</p>
<p>You can grab a copy from the plugin page on <a href="http://themehybrid.com/plugins/disable-post-format-ui" title="Theme Hybrid: Disable Post Format UI">Theme Hybrid</a> or from <a href="http://wordpress.org/extend/plugins/disable-post-format-ui/" title="WordPress: Disable Post Format UI">WordPress.org</a>.</p>
<h2>What does the plugin do, exactly?</h2>
<p>If you haven&#8217;t been keeping up with WordPress 3.6 development, you&#8217;re in for a treat.  WordPress is finally doing something about those ambiguous post formats.  From now on, all WordPress installs will support all post formats out of the box.  They&#8217;ve done some cool <abbr title="User Interface">UI</abbr> work on the edit post screen in the admin to make post formats much more usable for the average user.</p>
<p>The following is a screenshot of what this looks like.</p>
<p><img src="http://justintadlock.com/blog/wp-content/uploads/2013/05/post-format-ui.png" alt="Screenshot of the WordPress post format UI" width="700" height="176" class="aligncenter size-full wp-image-5037" /></p>
<p>This plugin simply disables this new <abbr title="User Interface">UI</abbr> and its functionality for people who have no need for post formats.</p>
]]></content:encoded>
			<wfw:commentRss>http://justintadlock.com/archives/2013/05/15/disable-post-format-ui-wordpress-plugin/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Hybrid Base theme</title>
		<link>http://justintadlock.com/archives/2013/03/08/hybrid-base-theme</link>
		<comments>http://justintadlock.com/archives/2013/03/08/hybrid-base-theme#comments</comments>
		<pubDate>Fri, 08 Mar 2013 17:19:05 +0000</pubDate>
		<dc:creator>Justin Tadlock</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Themes]]></category>

		<guid isPermaLink="false">http://justintadlock.com/?p=4992</guid>
		<description><![CDATA[If you&#8217;re interested in a base/starter theme for building your own custom WordPress themes, check out Hybrid Base. It&#8217;s also useful for learning how the Hybrid Core framework works. &#8734;]]></description>
				<content:encoded><![CDATA[<p>If you&#8217;re interested in a base/starter theme for building your own custom WordPress themes, check out <a href="http://themehybrid.com/weblog/hybrid-base-wordpress-theme" title="Hybrid Base WordPress theme">Hybrid Base</a>.  It&#8217;s also useful for learning how the Hybrid Core framework works. <a class="permalink" href="http://justintadlock.com/archives/2013/03/08/hybrid-base-theme" title="Hybrid Base theme">&#8734;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://justintadlock.com/archives/2013/03/08/hybrid-base-theme/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>First look at Twenty Thirteen</title>
		<link>http://justintadlock.com/archives/2013/02/18/first-look-at-twenty-thirteen</link>
		<comments>http://justintadlock.com/archives/2013/02/18/first-look-at-twenty-thirteen#comments</comments>
		<pubDate>Tue, 19 Feb 2013 00:06:33 +0000</pubDate>
		<dc:creator>Justin Tadlock</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://justintadlock.com/?p=4971</guid>
		<description><![CDATA[The first draft of the Twenty Thirteen theme is looking pretty awesome. Here&#8217;s the theme demo. &#8734;]]></description>
				<content:encoded><![CDATA[<p>The <a href="http://make.wordpress.org/core/2013/02/18/introducing-twenty-thirteen/" title="Introducing Twenty Thirteen">first draft</a> of the Twenty Thirteen theme is looking pretty awesome.  Here&#8217;s the <a href="http://twentythirteendemo.wordpress.com/" title="Twenty Thirteen Demo">theme demo</a>. <a class="permalink" href="http://justintadlock.com/archives/2013/02/18/first-look-at-twenty-thirteen" title="First look at Twenty Thirteen">&#8734;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://justintadlock.com/archives/2013/02/18/first-look-at-twenty-thirteen/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Three free responsive themes</title>
		<link>http://justintadlock.com/archives/2013/02/12/three-free-responsive-themes</link>
		<comments>http://justintadlock.com/archives/2013/02/12/three-free-responsive-themes#comments</comments>
		<pubDate>Tue, 12 Feb 2013 20:06:44 +0000</pubDate>
		<dc:creator>Justin Tadlock</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Themes]]></category>

		<guid isPermaLink="false">http://justintadlock.com/?p=4940</guid>
		<description><![CDATA[In the past week, three Theme Hybrid members have contributed awesome free (and responsive) themes back to the site: Shell, Spine, and Satu. &#8734;]]></description>
				<content:encoded><![CDATA[<p>In the past week, three Theme Hybrid members have contributed awesome free (and responsive) themes back to the site:  <a href="http://themehybrid.com/weblog/shellcreeper-and-the-shell-theme" title="Shell WordPress theme">Shell</a>, <a href="http://themehybrid.com/weblog/paul-on-wordpress-and-the-spine-theme" title="Spine WordPress theme">Spine</a>, and <a href="http://themehybrid.com/weblog/satu-wordpress-theme" title="Satu WordPress theme">Satu</a>. <a class="permalink" href="http://justintadlock.com/archives/2013/02/12/three-free-responsive-themes" title="Three free responsive themes">&#8734;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://justintadlock.com/archives/2013/02/12/three-free-responsive-themes/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Move over UI team</title>
		<link>http://justintadlock.com/archives/2013/02/06/move-over-ui-team</link>
		<comments>http://justintadlock.com/archives/2013/02/06/move-over-ui-team#comments</comments>
		<pubDate>Thu, 07 Feb 2013 00:14:02 +0000</pubDate>
		<dc:creator>Justin Tadlock</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Discussion]]></category>

		<guid isPermaLink="false">http://justintadlock.com/?p=4761</guid>
		<description><![CDATA[Are admin themes part of the answer to a simpler WordPress admin?]]></description>
				<content:encoded><![CDATA[<p>I want to start this article by thanking the people who put their time and effort into keeping the WordPress admin working.  It&#8217;s not easy, and I&#8217;m glad I&#8217;m not one of the people doing it.</p>
<p>But, let&#8217;s face it.  WordPress&#8217; admin is cluttered and complicated for many people.  It&#8217;s a miracle that the folks who work on it have been able to keep it together all this time. </p>
<p>I have a roommate who uses WordPress to run his blog.  However, I have a part-time job simply teaching him how to use it.  And, it&#8217;s been three years since I first set him up.  He&#8217;s not the brightest of fellows, but when I envision what WordPress should be like, I imagine WordPress.org featuring a picture of him with his testimonial &mdash; <em>So easy, a hick from Alabama can use it!</em></p>
<p>Over the past few years, WordPress has taken on a lot of new features.  However, the downside to adding new features is that you must squeeze them in alongside the existing features.  The new features are nice, but the WordPress admin has put on a few pounds.  It&#8217;s time to trim the fat.</p>
<p>The great thing about WordPress is that you can change something when you don&#8217;t like it.  You can take steps to unclutter the <a href="http://justintadlock.com/archives/2011/04/13/uncluttering-the-post-editing-screen-in-wordpress" title="Uncluttering the post editing screen">edit post screen</a>.  You can build a custom <a href="http://codex.wordpress.org/Function_Reference/wp_admin_css_color" title="WordPress Codex: wp_admin_css_color()">color scheme</a> to make your admin prettier.  Or, you can build a full-blown admin theme.  </p>
<p>Lately, there&#8217;s been a rising trend toward a <a href="http://wprealm.com/blog/the-road-to-a-simpler-wordpress-dashboard/" title="The Road to a Simpler WordPress Dashboard">simpler admin</a>.  Admin themes might just be one part of the equation to getting there.</p>
<h2>Why admin themes?</h2>
<p>Because they&#8217;re cool.</p>
<p>When developers create something new, it&#8217;s generally to solve a problem.  Admin themes can solve the following.</p>
<ul>
<li>Give users more options for what their WordPress admins can look like.  Wouldn&#8217;t it be awesome if theme developers were also releasing custom admin themes to go along with their regular themes?</li>
<li>Improve the WordPress <abbr title="User Interface">UI</abbr>.  With more options available, it will get more people involved in the core WordPress <abbr title="User Interface">UI</abbr>.  It will also present ideas to the <abbr title="User Interface">UI</abbr> team that maybe they haven&#8217;t thought of.</li>
</ul>
<p>With that in mind, let me introduce you to a new admin theme.</p>
<h2>DevPress Dashboard</h2>
<p>Over the past month or so, I&#8217;ve had a chance to talk with Tung Do about WordPress admin themes.  I&#8217;ve also been a test dummy for the past week while he perfected an <a href="http://devpress.com/plugins/dp-dashboard/" title="DevPress Dashboard: WordPress plugin">awesome plugin</a> that reshaped everything about the WordPress admin.</p>
<p>This is one of the most beautifully-designed admin themes I&#8217;ve seen in a long time.  It makes the clutter of the admin seem much more freeing.  I don&#8217;t know if it was just refreshing to see something new or if it&#8217;s just that damn nice, but I&#8217;m a fan.</p>
<p>The following is a screenshot of the &#8220;Dashboard&#8221; screen of the DevPress Dashboard plugin&#8217;s default design.  You can view more screenshots on the <a href="http://devpress.com/plugins/dp-dashboard/" title="DevPress Dashboard: WordPress plugin">plugin&#8217;s page</a>.</p>
<p><a href="http://justintadlock.com/archives/2013/02/06/move-over-ui-team/devpress-dashboard" rel="attachment wp-att-4765"><img src="http://justintadlock.com/blog/wp-content/uploads/2013/02/devpress-dashboard-960x967.png" alt="Screenshot of the DevPress Dashboard plugin" width="700" height="705" class="aligncenter size-large wp-image-4765" /></a></p>
<p>The only thing I might see that could keep this plugin from gaining traction is that you must be a member of DevPress to access it.  I&#8217;d much rather see a default plugin + theme combo for free with additional commercial designs.  Even still, the plugin alone is worth the price of membership at DevPress.</p>
<p class="alert">Shameless self-promotion:  DevPress themes are built off my <a href="http://themehybrid.com/hybrid-core" title="Hybrid Core WordPress theme framework">Hybrid Core</a> theme framework, so you&#8217;d be getting an awesome deal by joining the site.</p>
<h2>Where does WordPress go from here?</h2>
<p>For others to build beautiful admin themes, WordPress has a little shaping up to do.</p>
<p>First and foremost, inline styles halfway down the admin pages need to be moved into an external stylesheet where possible.  It&#8217;s extremely tough trying to write custom <abbr title="Cascading Style Sheets">CSS</abbr> when you&#8217;re hitting roadblocks like inline styles.</p>
<p>Another thing we need as plugin developers is even easier ways to build stuff in the admin.  The better tools we have to create things in a standardized fashion, the easier it is to style these things.  The goal should be to standardize as much as possible.  </p>
<p>Take a look at how easy it is to build theme customizer options.  That&#8217;s straight up theme developer crack.  I&#8217;ll take more of that, please.</p>
<h2>Stop building custom-designed admin screens</h2>
<p>Theme and plugin developers, please start using the tools available to you.  I have yet to figure out what&#8217;s so hard about using the built-in <a href="http://codex.wordpress.org/Settings_API" title="WordPress Codex:  Settings API">Settings <abbr title="Application Programming Interface">API</abbr></a>.  If you follow the rules, the rest of us can do some truly awesome stuff.</p>
<p>For theme developers, everything you need is there.  I&#8217;ve never seen a theme settings screen that required anything more than what&#8217;s available via the Settings <abbr title="Application Programming Interface">API</abbr>.  If it does, I&#8217;m 99.9% sure that you&#8217;re doing something you shouldn&#8217;t be doing in a theme.  Besides, who wants to build theme options pages anymore now that we have the theme customizer?</p>
<p>For plugin developers, there are situations where you need more robust admin screens.  <a href="https://www.e-junkie.com/ecom/gb.php?cl=54585&#038;c=ib&amp;aff=15259" title="Gravity Forms WordPress plugin">Gravity Forms</a> immediately comes to mind.  However, for the vast majority, what you need is built in.</p>
<p>If you have a scenario that core doesn&#8217;t handle well, propose it on <a href="http://core.trac.wordpress.org/" title="WordPress Trac">WordPress Trac</a>.  Submit a patch.  Get involved.</p>
<h2>More admin themes</h2>
<p>I&#8217;d love to see more WordPress admin themes in the future, but it might be a brutal slugfest with non-standard plugins/themes and WordPress itself.  Although, I believe WordPress core will eventually get there.</p>
<p>If you&#8217;re interested in developing admin themes, hop over to the <a href="https://github.com/justintadlock/admin-themes" title="GitHub: Admin Themes WordPress Plugin">Admin Themes</a> repository on GitHub.  It&#8217;s a little project I&#8217;m building to make it easy to build and use custom admin themes.  It&#8217;s in the extremely early stages, so don&#8217;t expect much yet.</p>
<p>And, if you&#8217;re interested in getting involved in the WordPress <abbr title="User Interface">UI</abbr>, head over the the <a href="http://make.wordpress.org/ui/" title="Make WordPress: UI"><abbr title="User Interface">UI</abbr> blog</a> and see what you can do to help.</p>
]]></content:encoded>
			<wfw:commentRss>http://justintadlock.com/archives/2013/02/06/move-over-ui-team/feed</wfw:commentRss>
		<slash:comments>36</slash:comments>
		</item>
		<item>
		<title>WordPress creates category &#8220;pages&#8221; for you</title>
		<link>http://justintadlock.com/archives/2013/01/31/wordpress-creates-category-pages-for-you</link>
		<comments>http://justintadlock.com/archives/2013/01/31/wordpress-creates-category-pages-for-you#comments</comments>
		<pubDate>Thu, 31 Jan 2013 20:49:04 +0000</pubDate>
		<dc:creator>Justin Tadlock</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Tutorials]]></category>

		<guid isPermaLink="false">http://justintadlock.com/?p=4734</guid>
		<description><![CDATA[A tutorial on how to add category archives to your site in WordPress.]]></description>
				<content:encoded><![CDATA[<p>Every so often, I get a support question that goes something like this:</p>
<blockquote><p>
I want a special page on my site that lists posts from only one category.  I know I need to create a custom page template for this, but how do I make it load just the posts from my category?
</p></blockquote>
<p>I don&#8217;t get asked this too often, but when it does come around, it usually gets asked multiple times in the same week for some reason.  The problem is that you don&#8217;t have to write any kind of code or create a custom page template.  WordPress has already created the page for you.  This is called a &#8220;category archive.&#8221;</p>
<p>WordPress actually creates all kinds of archives.  You have taxonomy term archives, author archives, time-/date-based archives, and the potential for many more.  So, sometimes these pages already exist and you&#8217;re just not aware of them.</p>
<h2>How to show the category archive in a menu</h2>
<p>Most folks are concerned with adding the category archive to their menu so their visitors can easily find the page.  We&#8217;re so used to thinking of pages being in the menu that we don&#8217;t think of adding other items.  In the past, this was pretty much the only choice available without writing some code.  However, WordPress&#8217; nav menus system takes care of that.</p>
<p>To add a category archive to one of your menus, go to &#8220;Appearance > Menus&#8221; in the WordPress admin.  Look for the section labeled &#8220;Categories.&#8221;  Then, select the categories you want and add them to your menu.</p>
<p>The following screenshot illustrates what this looks like.</p>
<div id="attachment_4735" class="wp-caption aligncenter" style="width: 784px"><img src="http://justintadlock.com/blog/wp-content/uploads/2013/01/nav-menu-categories.png" alt="Screenshot of adding a category to a WordPress nav menu" width="774" height="533" class="size-full wp-image-4735" /><p class="wp-caption-text">Nav menu with category</p></div>
<h2>Altering the output of the category archive</h2>
<p>Some users still want this page to display different data than the other archive-type pages for their special category.  That&#8217;s easily doable.</p>
<p>To do this, you can create a <code>category-$slug.php</code> template where <code>$slug</code> is your category slug.  Within that file, you can create anything you want.  It&#8217;ll overwrite the template your theme normally uses to display category archives. </p>
<p>Keep in mind that many themes do things differently when it comes to templates, so get in touch with your theme author if you need help with this.</p>
<p class="warning">If you&#8217;re using any of my themes or themes built off <a href="http://themehybrid.com/hybrid-core" title="Hybrid Core WordPress theme framework">Hybrid Core</a>, the template name should be <code>taxonomy-category-$slug.php</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://justintadlock.com/archives/2013/01/31/wordpress-creates-category-pages-for-you/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How to change your author archive link</title>
		<link>http://justintadlock.com/archives/2013/01/29/how-to-change-your-author-archive-link</link>
		<comments>http://justintadlock.com/archives/2013/01/29/how-to-change-your-author-archive-link#comments</comments>
		<pubDate>Tue, 29 Jan 2013 19:56:25 +0000</pubDate>
		<dc:creator>Justin Tadlock</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Tutorials]]></category>

		<guid isPermaLink="false">http://justintadlock.com/?p=4712</guid>
		<description><![CDATA[How to point your author archive link to a more useful page on your site.]]></description>
				<content:encoded><![CDATA[<p>One of the things that has always bugged me about WordPress themes is the author posts <abbr title="Uniform Resource Locator">URL</abbr>. This is the <abbr title="Uniform Resource Locator">URL</abbr> used to link to your author archive and is a standard piece of data used when showing posts in most themes. The author link is usually in the byline or post meta area of a post.</p>
<p>In general, this is great. For multi-author sites, it allows you to look at a specific author&#8217;s posts. However, the author archive is pointless for single-author sites like my blog here because it&#8217;s no different than the regular blog/home/posts page.</p>
<p>This tutorial will teach you a few techniques for dealing with this. Most of the code samples in this tutorial should go into a <a title="Creating a custom functions plugin for end users" href="http://justintadlock.com/archives/2011/02/02/creating-a-custom-functions-plugin-for-end-users">custom functions plugin</a>.</p>
<h2>Point the <abbr title="Uniform Resource Locator">URL</abbr> to your &#8220;about&#8221; page</h2>
<p>I like this option. Many sites have an &#8220;about&#8221; or &#8220;about me&#8221; page. This would be far more useful than another archive listing the same posts listed in your regular posts archive.</p>
<p>The following code will handle that scenario. Just replace <code>about</code> with the slug of the page you want to point to on your site.</p>
<pre><code>add_filter( 'author_link', 'my_author_link' );

function my_author_link() {
	return home_url( 'about' );
}</code></pre>
<p>If you have multiple authors but still want to do this, you can check for the user ID first. Just change the <code>100</code> to the ID of the user you want to use this technique for.</p>
<pre><code>add_filter( 'author_link', 'my_multi_author_link', 10, 2 );

function my_multi_author_link( $url, $user_id ) {

	if ( 100 === $user_id )
		return home_url( 'about' );

	return $url;
}</code></pre>
<h2>Redirect your author archive</h2>
<p>Another technique is to redirect your author archive to the page of your choosing. This is a good option if you don&#8217;t want anyone to directly access your author archive at all. The previous technique merely changed the public-facing links to the archive.</p>
<p>The following code will redirect any attempt to access an author archive to your &#8220;about&#8221; page. You can use <code>301</code> for a permanent redirect or leave it at <code>302</code> for a temporary redirect.</p>
<pre><code>add_action( 'template_redirect', 'my_redirect_author_archive' );

function my_redirect_author_archive() {

	if ( is_author() ) {
		wp_redirect( home_url( 'about' ), 302 );
		exit;
	}
}</code></pre>
<p>You can also do this for specific author archives by changing <code>is_author()</code> to <code>is_author( $author )</code>. For more information on the <code>is_author()</code> function, check out the <a title="WordPress Codex: is_author()" href="http://codex.wordpress.org/Function_Reference/is_author">function&#8217;s page</a> in the WordPress Codex.</p>
<h2>What can theme authors do?</h2>
<p>If you&#8217;re a theme author, you can make checks for single-author vs. multi-author blogs. WordPress has this nifty conditional function called <code>is_multi_author()</code>. It allows you to check whether multiple users have written posts. I sometimes use it when adding an author profile box after single views of posts.</p>
<p>A simple option for displaying an author&#8217;s posts <abbr title="Uniform Resource Locator">URL</abbr> only if there are multiple authors is the following. It will display the author name if it&#8217;s not a multi-author blog.</p>
<pre><code>&lt;?php is_multi_author() ? the_author_posts_link() : the_author(); ?&gt;</code></pre>
<p>Of course, there are other things you can show/hide depending on your theme. The above just illustrates the use of the <code>is_multi_author()</code> function.</p>
]]></content:encoded>
			<wfw:commentRss>http://justintadlock.com/archives/2013/01/29/how-to-change-your-author-archive-link/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Portfolio plugin and theme</title>
		<link>http://justintadlock.com/archives/2013/01/28/portfolio-plugin-and-theme</link>
		<comments>http://justintadlock.com/archives/2013/01/28/portfolio-plugin-and-theme#comments</comments>
		<pubDate>Mon, 28 Jan 2013 20:20:03 +0000</pubDate>
		<dc:creator>Justin Tadlock</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Plugins]]></category>
		<category><![CDATA[WordPress Themes]]></category>

		<guid isPermaLink="false">http://justintadlock.com/?p=4704</guid>
		<description><![CDATA[I released a new portfolio plugin and theme on Theme Hybrid today. Check them out. I&#8217;m also using a custom version of the theme here on this site now. &#8734;]]></description>
				<content:encoded><![CDATA[<p>I released a new <a href="http://themehybrid.com/weblog/dual-release-portfolio-plugin-and-theme" title="Dual release: Portfolio plugin and theme">portfolio plugin and theme</a> on Theme Hybrid today.  Check them out.  I&#8217;m also using a custom version of the theme here on this site now. <a class="permalink" href="http://justintadlock.com/archives/2013/01/28/portfolio-plugin-and-theme" title="Portfolio plugin and theme">&#8734;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://justintadlock.com/archives/2013/01/28/portfolio-plugin-and-theme/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Blackballed at WordCamps</title>
		<link>http://justintadlock.com/archives/2013/01/22/blackballed-at-wordcamps</link>
		<comments>http://justintadlock.com/archives/2013/01/22/blackballed-at-wordcamps#comments</comments>
		<pubDate>Tue, 22 Jan 2013 17:10:03 +0000</pubDate>
		<dc:creator>Justin Tadlock</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Discussion]]></category>

		<guid isPermaLink="false">http://justintadlock.com/?p=4693</guid>
		<description><![CDATA[Yet another person not allowed to contribute at WordCamps. Surprised? Not me. &#8734;]]></description>
				<content:encoded><![CDATA[<p>Yet another person <a href="http://www.designcrumbs.com/automattically-blackballed/" title="Automattically Blackballed">not allowed to contribute</a> at WordCamps.  <em>Surprised?</em>  Not me. <a class="permalink" href="http://justintadlock.com/archives/2013/01/22/blackballed-at-wordcamps" title="Blackballed at WordCamps">&#8734;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://justintadlock.com/archives/2013/01/22/blackballed-at-wordcamps/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Disallow specific shortcodes in post content</title>
		<link>http://justintadlock.com/archives/2013/01/08/disallow-specific-shortcodes-in-post-content</link>
		<comments>http://justintadlock.com/archives/2013/01/08/disallow-specific-shortcodes-in-post-content#comments</comments>
		<pubDate>Tue, 08 Jan 2013 23:35:00 +0000</pubDate>
		<dc:creator>Justin Tadlock</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Tutorials]]></category>

		<guid isPermaLink="false">http://justintadlock.com/?p=4680</guid>
		<description><![CDATA[How theme developers can disallow the use of theme shortcodes in the post content.]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m no fan of WordPress themes adding shortcodes.  I&#8217;ve been pretty <a href="http://justintadlock.com/archives/2011/05/02/dealing-with-shortcode-madness" title="Dealing with shortcode madness">adamant about it</a> in the past.  But, all rules have exceptions, right?</p>
<p><em>So, you&#8217;re telling me that you &mdash; the guy who&#8217;s been drilling it into my head to not add theme shortcodes &mdash; that it might now be okay?</em></p>
<p>Well, yes.  Technically, I&#8217;ve always been okay with themes adding shortcodes as long as those shortcodes are not <strong>intended to be used in the post content</strong>.</p>
<p>Shortcodes can be used for any number of purposes.  Generally speaking, developers create shortcodes to be used in the post content.  For this reason alone, shortcodes belong in a plugin.  However, if you&#8217;re creating a shortcode to be used in other places where data portability is not an issue, go wild.</p>
<p>Here&#8217;s a few examples of what I consider exceptions to the rule:</p>
<ul>
<li>Shortcodes for use in theme templates.</li>
<li>Shortcodes for use in theme settings, such as the footer text.</li>
<li>Shortcodes for use in widgets (this is probably a bit of a gray area to some).</li>
</ul>
<p>The problem is that users can still use these shortcodes in the post content even if it wasn&#8217;t your <em>intention</em> to allow them to do so.  This discussion came up in the <a href="http://make.wordpress.org/themes/2012/11/26/wordpress-3-5-guidelines-revisions/" title="WordPress 3.5 Guidelines Revisions">comments</a> on the proposed WordPress 3.5 theme guideline revisions.  This tutorial will show you how to avoid that scenario.</p>
<h2>Adding shortcodes</h2>
<p>I&#8217;m going to assume you&#8217;re already familiar with the process of adding shortcodes using WordPress&#8217; <a href="http://codex.wordpress.org/Function_Reference/add_shortcode" title="WordPress Codex: add_shortcode()">add_shortcode()</a> function, so I won&#8217;t cover that.</p>
<p>The following is an example of a few theme-defined shortcodes and how they should be set up.</p>
<pre><code>add_action( 'init', 'my_add_shortcodes' );

function my_add_shortcodes() {

	add_shortcode( 'shortcode_1', 'my_shortcode_1' );
	add_shortcode( 'shortcode_2', 'my_shortcode_2' );
	add_shortcode( 'shortcode_3', 'my_shortcode_3' );
}</code></pre>
<p>This is just to give you a base to work with for the remainder of this tutorial.  You can set up your own shortcodes however you like.</p>
<h2>Not allowing theme shortcodes in the post content</h2>
<p>We don&#8217;t want our shortcodes to be used at all in the post content.  The best option here is to simply remove them when the <code>the_content</code> filter hook is called.  WordPress makes this extremely easy with the <a href="http://codex.wordpress.org/Function_Reference/remove_shortcode" title="WordPress Codex: remove_shortcode()">remove_shortcode()</a> function.</p>
<p>The following code will remove the three shortcodes we added earlier.</p>
<pre><code>add_filter( 'the_content', 'my_post_content_remove_shortcodes', 0 );

function my_post_content_remove_shortcodes( $content ) {

	/* Create an array of all the shortcode tags. */
	$shortcode_tags = array(
		'shortcode_1',
		'shortcode_2',
		'shortcode_3'
	);

	/* Loop through the shortcodes and remove them. */
	foreach ( $shortcode_tags as $shortcode_tag )
		remove_shortcode( $shortcode_tag );

	/* Return the post content. */
	return $content;
}</code></pre>
<p><em>Wait!  Won&#8217;t that permanently remove the shortcodes?</em>  Yes, it will.  Therefore, you must add them back so they can be used outside of <code>the_content</code>.  The following code does just that.</p>
<pre><code>add_filter( 'the_content', 'my_post_content_add_shortcodes', 99 );

function my_post_content_add_shortcodes( $content ) {

	/* Add the original shortcodes back. */
	my_add_shortcodes();

	/* Return the post content. */
	return $content;
}</code></pre>
<h2>Thoughts?  Other solutions?</h2>
<p>I agree that this seems like a bit of a hack, but it&#8217;s the best option I&#8217;ve found thus far and doesn&#8217;t take much code.  I&#8217;m open to suggestions on better methods.</p>
<p>The great news is that you don&#8217;t have to worry about your users messing up their content by using shortcodes that you didn&#8217;t intend for use in the post content.  They&#8217;ll know upon any attempts to do so that it simply won&#8217;t work.</p>
]]></content:encoded>
			<wfw:commentRss>http://justintadlock.com/archives/2013/01/08/disallow-specific-shortcodes-in-post-content/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
