<?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>TJ Singleton &#187; Wordpress</title>
	<atom:link href="http://tjsingleton.name/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://tjsingleton.name</link>
	<description>Software Engineer, Baptist Preacher</description>
	<lastBuildDate>Thu, 01 Jul 2010 17:28:14 +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>WordPress Bug with Reading Settings, Front Page Displays</title>
		<link>http://tjsingleton.name/2010/05/wordpress-bug-with-reading-settings-front-page-displays/</link>
		<comments>http://tjsingleton.name/2010/05/wordpress-bug-with-reading-settings-front-page-displays/#comments</comments>
		<pubDate>Tue, 11 May 2010 19:28:24 +0000</pubDate>
		<dc:creator>TJ Singleton</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://tjsingleton.name/?p=232</guid>
		<description><![CDATA[I came across a bug today where despite the fact the Reading settings were set to the latest posts, that the Front Page setting was still affecting the menu structure of wordpress. Notice in the following images that "About" page is absent from the breadcrumbs, and is marked as excluded from the navigation. The fix [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://tjsingleton.name/wp-content/uploads/2010/05/Screen-shot-2010-05-11-at-3.08.16-PM.png"><img class="size-full wp-image-233" title="Screen shot 2010-05-11 at 3.08.16 PM" src="http://tjsingleton.name/wp-content/uploads/2010/05/Screen-shot-2010-05-11-at-3.08.16-PM.png" alt="" width="558" height="200" /></a></p>
<p>I came across a bug today where despite the fact the Reading settings were set to the latest posts, that the Front Page setting was still affecting the menu structure of wordpress.</p>
<p>Notice in the following images that "About" page is absent from the breadcrumbs, and is marked as excluded from the navigation.</p>
<p><a href="http://tjsingleton.name/wp-content/uploads/2010/05/Screen-shot-2010-05-11-at-3.08.48-PM.png"><img class="size-full wp-image-235 alignleft" title="Screen shot 2010-05-11 at 3.08.48 PM" src="http://tjsingleton.name/wp-content/uploads/2010/05/Screen-shot-2010-05-11-at-3.08.48-PM.png" alt="" width="419" height="177" /></a><a href="http://tjsingleton.name/wp-content/uploads/2010/05/Screen-shot-2010-05-11-at-3.08.29-PM.png"><img class="size-full wp-image-236 alignleft" title="Screen shot 2010-05-11 at 3.08.29 PM" src="http://tjsingleton.name/wp-content/uploads/2010/05/Screen-shot-2010-05-11-at-3.08.29-PM.png" alt="" width="229" height="55" /></a><a href="http://tjsingleton.name/wp-content/uploads/2010/05/Screen-shot-2010-05-11-at-3.09.05-PM.png"><img class="size-full wp-image-237 alignleft" title="Screen shot 2010-05-11 at 3.09.05 PM" src="http://tjsingleton.name/wp-content/uploads/2010/05/Screen-shot-2010-05-11-at-3.09.05-PM.png" alt="" width="294" height="101" /></a></p>
<p class="clear">The fix is simple. Just update the Front Page setting to the empty option and the menu correct hierarchy is restored. </p>
]]></content:encoded>
			<wfw:commentRss>http://tjsingleton.name/2010/05/wordpress-bug-with-reading-settings-front-page-displays/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bulk deleting posts in WordPress</title>
		<link>http://tjsingleton.name/2010/05/bulk-deleting-posts-in-wordpress/</link>
		<comments>http://tjsingleton.name/2010/05/bulk-deleting-posts-in-wordpress/#comments</comments>
		<pubDate>Mon, 10 May 2010 23:00:58 +0000</pubDate>
		<dc:creator>TJ Singleton</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://tjsingleton.name/?p=228</guid>
		<description><![CDATA[I was importing posts into wordpress and messed up. It's not uncommon. I normally have a couple failed attempts, before I get everything zeroed in with a new csv template. I've learned my lesson in the past so I always set the post author to a distinct user to easily bulk delete posts based on [...]]]></description>
			<content:encoded><![CDATA[<p>I was importing posts into wordpress and messed up. It's not uncommon.  I normally have a couple failed attempts, before I get everything zeroed in with a new csv template.  </p>
<p>I've learned my lesson in the past so I always set the post author to a distinct user to easily bulk delete posts based on the post_author with sql.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">DELETE</span> <span style="color: #993333; font-weight: bold;">FROM</span> wp_postmeta 
<span style="color: #993333; font-weight: bold;">WHERE</span> post_author <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">50</span></pre></div></div>

<p> However, this leaves trash in the wp_postmeta table so now we just clean that up by deleting everything without a entry in wp_posts.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">DELETE</span> <span style="color: #993333; font-weight: bold;">FROM</span> wp_postmeta
<span style="color: #993333; font-weight: bold;">WHERE</span> post_id <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #66cc66;">&#40;</span>
  <span style="color: #993333; font-weight: bold;">SELECT</span> id
  <span style="color: #993333; font-weight: bold;">FROM</span> wp_posts
<span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>Now that there is no trace of my failed attempt I can reprocess the file, hopefully successfully this time. </p>
]]></content:encoded>
			<wfw:commentRss>http://tjsingleton.name/2010/05/bulk-deleting-posts-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove the Genesis Favicon</title>
		<link>http://tjsingleton.name/2010/04/remove-the-genesis-favicon/</link>
		<comments>http://tjsingleton.name/2010/04/remove-the-genesis-favicon/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 02:39:25 +0000</pubDate>
		<dc:creator>TJ Singleton</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://tjsingleton.name/?p=224</guid>
		<description><![CDATA[remove_action&#40;'genesis_meta', 'genesis_load_favicon'&#41;;]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">remove_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'genesis_meta'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'genesis_load_favicon'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://tjsingleton.name/2010/04/remove-the-genesis-favicon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use shortcodes in widgets</title>
		<link>http://tjsingleton.name/2010/04/how-to-use-shortcodes-in-widgets/</link>
		<comments>http://tjsingleton.name/2010/04/how-to-use-shortcodes-in-widgets/#comments</comments>
		<pubDate>Sat, 10 Apr 2010 04:03:44 +0000</pubDate>
		<dc:creator>TJ Singleton</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://tjsingleton.name/?p=217</guid>
		<description><![CDATA[Want to use shortcodes in your text widget? Just add this snippet to your functions file. add_filter&#40;'widget_text', 'shortcode_widgets'&#41;; function shortcode_widgets&#40;$widget_text&#41; &#123; ob_start&#40;&#41;; do_shortcode&#40;$widget_text&#41;; $captured_content = ob_get_contents&#40;&#41;; ob_end_clean&#40;&#41;; return $captured_content; &#125;]]></description>
			<content:encoded><![CDATA[<p>Want to use shortcodes in your text widget? Just add this snippet to your functions file.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'widget_text'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'shortcode_widgets'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> shortcode_widgets<span style="color: #009900;">&#40;</span><span style="color: #000088;">$widget_text</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #990000;">ob_start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  do_shortcode<span style="color: #009900;">&#40;</span><span style="color: #000088;">$widget_text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$captured_content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ob_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #990000;">ob_end_clean</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$captured_content</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://tjsingleton.name/2010/04/how-to-use-shortcodes-in-widgets/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adding Cachable Javascript and CSS links to your WordPress Theme</title>
		<link>http://tjsingleton.name/2010/02/adding-cachable-javascript-and-css-to-your-wordpress-theme/</link>
		<comments>http://tjsingleton.name/2010/02/adding-cachable-javascript-and-css-to-your-wordpress-theme/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 04:52:10 +0000</pubDate>
		<dc:creator>TJ Singleton</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://tjsingleton.name/?p=83</guid>
		<description><![CDATA[Here is a great technique for adding a timestamp to your the javascript and css for your theme using enqueue_script and enqueue_style. The benefit is you can set a far future expires header and maximize the caching benefit without having to worry about cache invalidation. This technique should be familiar to any Rails devs as [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a great technique for adding a timestamp to your the javascript and css for your theme using <a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_script">enqueue_script</a> and <a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_style">enqueue_style</a>. The benefit is you can set a <a href="http://developer.yahoo.com/performance/rules.html#expires">far future expires header</a> and maximize the caching benefit without having to worry about cache invalidation. This technique should be familiar to any Rails devs as it's baked in.</p>
<p>The magic is that the one of the optional parameters of the enqueue_* functions is a version. We can use php's <a href="http://www.php.net/manual/en/function.filemtime.php">filemtime</a> function to get the last modified time of the file as a timestamp and use it for the version. WordPress appends the version to the end of the url like "http://yoursite.com/wp-content/themes/your-theme/style.css?ver=1265429348". Now you don't have to worry about serving stale data since every time you edit the file the url will be updated.</p>
<p>Here is some example code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">  <span style="color: #000088;">$stylesheet_url</span> <span style="color: #339933;">=</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'stylesheet_url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$stylesheet_path</span> <span style="color: #339933;">=</span> TEMPLATEPATH<span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/style.css&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$stylesheet_mtime</span> <span style="color: #339933;">=</span> <span style="color: #990000;">filemtime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$stylesheet_path</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  wp_enqueue_style<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;my_theme&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$stylesheet_url</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #000088;">$stylesheet_mtime</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;screen&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000088;">$javascript_url</span> <span style="color: #339933;">=</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'stylesheet_directory'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/my_theme.js&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$javascript_path</span> <span style="color: #339933;">=</span> TEMPLATEPATH<span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/my_theme.js&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$javascript_mtime</span> <span style="color: #339933;">=</span> <span style="color: #990000;">filemtime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$javascript_path</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  wp_enqueue_script<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'my_theme'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$javascript_url</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #000088;">$javascript_mtime</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_redirect'</span><span style="color: #339933;">,</span> theme_assets<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://tjsingleton.name/2010/02/adding-cachable-javascript-and-css-to-your-wordpress-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Home Title Not Displaying Correctly with All in One SEO Pack</title>
		<link>http://tjsingleton.name/2009/08/home-title-not-displaying-corretly-with-all-in-one-seo-pack/</link>
		<comments>http://tjsingleton.name/2009/08/home-title-not-displaying-corretly-with-all-in-one-seo-pack/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 03:50:58 +0000</pubDate>
		<dc:creator>TJ Singleton</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://tjsingleton.name/?p=35</guid>
		<description><![CDATA[A client contacted me that the custom home title had stopped working with their install of the All in One SEO Pack. The site was using a home.php file to provide a custom home template. The problem was that in the reading settings "A static page" was selected even though no front page or posts [...]]]></description>
			<content:encoded><![CDATA[<p>A client contacted me that the custom home title had stopped working with their install of the All in One SEO Pack. The site was using a home.php file to provide a custom home template. The problem was that in the reading settings "A static page" was selected even though no front page or posts page was selected.</p>
<p style="text-align: center;"><img class="size-medium wp-image-36 aligncenter" title="Wordpress Settings - All In One SEO Pack Problem" src="http://tjsingleton.name/wp-content/uploads/2009/08/Picture-1-300x88.png" alt="Wordpress Settings - All In One SEO Pack Problem" width="300" height="88" /></p>
<p style="text-align: left;">Once updated to "Your latest posts" it worked correctly. Hopefully this will save you some time if you run across the same issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://tjsingleton.name/2009/08/home-title-not-displaying-corretly-with-all-in-one-seo-pack/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
