<?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>Sean Hayes - professional WordPress consulting &#187; sean</title>
	<atom:link href="http://www.seanhayes.biz/author/sean/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.seanhayes.biz</link>
	<description></description>
	<lastBuildDate>Mon, 26 Dec 2011 19:53:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Post comments not allowed if comment metabox removed</title>
		<link>http://www.seanhayes.biz/2011/post-comments-not-allowed-if-comment-metabox-removed/</link>
		<comments>http://www.seanhayes.biz/2011/post-comments-not-allowed-if-comment-metabox-removed/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 19:52:44 +0000</pubDate>
		<dc:creator>sean</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Comments]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.seanhayes.biz/?p=482</guid>
		<description><![CDATA[When building a site for clients it&#8217;s nice to clean out the Admin Dashboard screen of some of the unnecessary (and possibly dangerous) sections and checkboxes to avoid distractions when creating or editing their content. WordPress is flexible enough to allow sections, or meta boxes, to be easily removed through the use of the remove_meta_box [...]]]></description>
			<content:encoded><![CDATA[<p>When building a site for clients it&#8217;s nice to clean out the Admin Dashboard screen of some of the unnecessary (and possibly dangerous) sections and checkboxes to avoid distractions when creating or editing their content. WordPress is flexible enough to allow sections, or meta boxes, to be easily removed through the use of the <a rel="nofollow" title="Remove Meta Box" href="http://www.seanhayes.biz/goto/remove_meta_box/482/1" target="_blank">remove_meta_box</a> function. The code can be added to the functions.php file.</p>
<p>One of the meta boxes that can be removed is the Comments or Discussion meta box. This box lives in the lower half of the Edit post screen. It allows you to set the post, or page, to accept or deny comments and trackbacks/pings. I&#8217;ve been working on a couple of sites for some clients and it was originally decided not to have comments at the launch. I removed the comments options from the post screen and removed the call to the comment template in the sites theme files.</p>
<p>Then the client changed their mind and would like comment functionality restored. Now, it&#8217;s some time into the life of the site and the previously created posts are showing that comments are closed and the client want to add the ability for all posts to allow comments. It is easy to edit the theme files and add back in the &#8220;comment_template()&#8221; code and that would be that. However, the posts still show &#8220;Comments are closed&#8221;.</p>
<p>In Settings, Discussion there are no restrictions for commenting so it&#8217;s a little confusing that comments are not showing.</p>
<p>After working a little further on this I found the trick, which can be a little time consuming if you have lots of posts. Either edit, or quick edit, <em>each affected post</em> and tick the box that says &#8220;Allow Comments&#8221;.</p>
<div id="attachment_489" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.seanhayes.biz/wp-content/uploads/2011/12/allow-comments.png"><img class="size-full wp-image-489 " title="Allow Comments" src="http://www.seanhayes.biz/wp-content/uploads/2011/12/allow-comments.png" alt="Allow Comments in edit post" width="300" height="90" /></a><p class="wp-caption-text">Allow Comments in edit post</p></div>
<p>After doing that for each post you should find that normal comment functionality is restored for all posts and for new projects I always try and identify the comment requirements at the outset.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seanhayes.biz/2011/post-comments-not-allowed-if-comment-metabox-removed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Slow WordPress tag queries</title>
		<link>http://www.seanhayes.biz/2011/slow-wordpress-tag-queries/</link>
		<comments>http://www.seanhayes.biz/2011/slow-wordpress-tag-queries/#comments</comments>
		<pubDate>Wed, 08 Jun 2011 17:15:35 +0000</pubDate>
		<dc:creator>sean</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.seanhayes.biz/?p=468</guid>
		<description><![CDATA[While working on a real estate project I encountered very slow response from WordPress on certain queries. These queries are multiple tag queries in the form: http://www.site.com/tag/TAG_ONE+TAG_TWO My application is using WordPress tags to annotate the content and I am providing links to those multiple tag queries throughout the site. Over time and while I [...]]]></description>
			<content:encoded><![CDATA[<p>While working on a real estate project I encountered very slow response from WordPress on certain queries. These queries are multiple tag queries in the form:</p>
<blockquote><p>http://www.site.com/tag/TAG_ONE+TAG_TWO</p></blockquote>
<p>My application is using WordPress tags to annotate the content and I am providing links to those multiple tag queries throughout the site. Over time and while I was developing the site I noticed the site response getting slower and slower when I clicked on these links and yet there are times when the response was within the acceptable range. My hosting service was also affected and I was seeing high CPU usage when one of these queries was triggered. I decided to investigate.</p>
<p>I bounced between my Apache configuration, my MySQL configuration and the external database I was also querying. I had used the external database in a previous project and I was fairly confident I had not introduced any issues there. The queries I was performing were responding well within acceptable times and using mtop on my hosting console I was seeing WordPress queries hogging the resources.<a href="http://www.seanhayes.biz/wp-content/uploads/2011/06/mysql.jpg"><img class="alignright size-thumbnail wp-image-474" title="MySQL query" src="http://www.seanhayes.biz/wp-content/uploads/2011/06/mysql-150x150.jpg" alt="MySQL query" width="150" height="150" /></a></p>
<p>I changed the settings in my MySQL configuration file to increase buffers, heaps, table sizes and more. Improvements were minimal where there were any and in other cases no change. I didn&#8217;t think I was doing anything beyond the scope of WordPress (although I always like to learn) so I started searching to see if anyone else was experiencing the same or similar issues.</p>
<p>I found the usual and variable guides on how to speed up WordPress and more about taxonomy queries. I found there were reports of issues after a recent WordPress upgrade &#8211; support questions were posted <a rel="nofollow" title="WordPress and MySQL slow queries" href="http://www.seanhayes.biz/goto/here/468/2" target="_blank">here</a> and <a rel="nofollow" title="WordPress high cpu usage after upgrade" href="http://www.seanhayes.biz/goto/here/468/3" target="_blank">here</a>.</p>
<p>Digging deeper I did come across a WordPress Trac ticket <a rel="nofollow" href="http://www.seanhayes.biz/goto/http_core_trac_wordpress_org_ticket_16706/468/4">http://core.trac.wordpress.org/ticket/16706</a> and that seemed to be very similar to my issue.  I have been keeping my installations up to date so I could see that I became affected at that same upgrade point. Reading the Trac ticket it seems a resolution to this issue is due in the next release of WordPress (3.2) but I wanted to find out if it really did fix my issue. I upgraded my site to 3.2 beta and applied the patch mentioned in the ticket. The difference is huge and the site response time is much closer to where it should be.</p>
<p>Reading through the Trac ticket the explanation of the issue and the fix is purely down to optimization of the query built when WordPress is required to display information based on multiple categories or tags.</p>
<p>**UPDATE**: It seems that these multi tag queries are operating efficiently after upgrading to WordPress 3.2+ and this hint/tip might no longer be valid or required.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seanhayes.biz/2011/slow-wordpress-tag-queries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Importing data into WordPress</title>
		<link>http://www.seanhayes.biz/2011/importing-data-into-wordpress/</link>
		<comments>http://www.seanhayes.biz/2011/importing-data-into-wordpress/#comments</comments>
		<pubDate>Wed, 27 Apr 2011 01:37:08 +0000</pubDate>
		<dc:creator>sean</dc:creator>
				<category><![CDATA[real estate]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[listings]]></category>

		<guid isPermaLink="false">http://www.seanhayes.biz/?p=413</guid>
		<description><![CDATA[I&#8217;ve been working on a project that requires me to reference an external database of property listings &#8211; 106,000 of them &#8211; and display these listings in WordPress. One way I thought of was to create a plugin to read the listing data into WordPress, create a post and custom meta fields (or even a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on a project that requires me to reference an external database of property listings &#8211; 106,000 of them &#8211; and display these listings in WordPress.</p>
<p>One way I thought of was to create a plugin to read the listing data into WordPress, create a post and custom meta fields (or even a custom post type) with all that listing information and then  categorize / tag each post allowing themes to organize the listings as needed. I reviewed that idea didn&#8217;t think it was necessary to duplicate the real estate listing data in the WordPress database.</p>
<p>But, if I could create posts with ids that match the listing id then with the help of a shortcode, I could create posts and the shortcode would pull the listing data when a post is viewed.<a href="http://www.seanhayes.biz/wp-content/uploads/2011/04/wordpress-import-listings.jpg"><img class="alignright size-full wp-image-461" title="WordPress Import Real Estate Listings" src="http://www.seanhayes.biz/wp-content/uploads/2011/04/wordpress-import-listings.jpg" alt="WordPress Import Real Estate Listings" width="188" height="70" /></a></p>
<p>I thought it would work so I reviewed the <a rel="nofollow" title="Wordpress - wp_insert_post" href="http://www.seanhayes.biz/goto/wp_insert_post/413/2">wp_insert_post</a> function in the Codex and found it had a parameter &#8220;import_id&#8221;. Now, if I could make that import_id match the real estate listing id I could easily use the categorization and tagging capabilities of WordPress to organize the posts. When populating the WordPress site I query for and retrieve the listing ids from the database, get the id and create the post. Then, just after the post creation process I further query the listings database and create the categories and tags I need assigning them to each post id.</p>
<p>With all the listings referenced in WordPress I can search on and display posts by category and tag or include some external searching capability to get the IDs I want and then use WordPress to display the listings that matched the search.</p>
<p>For the purposes of the project this method worked, but with one side effect. All the menus, pages and other WordPress elements are numbered like the posts. So, at some point, there may be a clash between a numbered menu item and a real estate listing with the same id but I&#8217;ve yet to hit it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seanhayes.biz/2011/importing-data-into-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding Child Theme filters and Twenty Ten</title>
		<link>http://www.seanhayes.biz/2011/adding-child-theme-filters-and-twenty-ten/</link>
		<comments>http://www.seanhayes.biz/2011/adding-child-theme-filters-and-twenty-ten/#comments</comments>
		<pubDate>Tue, 15 Feb 2011 00:40:20 +0000</pubDate>
		<dc:creator>sean</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.seanhayes.biz/?p=402</guid>
		<description><![CDATA[Working on a child theme project for a client I found that my filter modifications for both &#8216;excerpt_length&#8217; and &#8216;excerpt_more&#8221; were not being processed. My child theme is based on Twenty Ten and the filters I was using had already been filtered by the parent theme. So, I had added my custom filters and the [...]]]></description>
			<content:encoded><![CDATA[<p>Working on a child theme project for a client I found that my filter modifications for both &#8216;excerpt_length&#8217; and &#8216;excerpt_more&#8221; were not being processed. My child theme is based on Twenty Ten and the filters I was using had already been filtered by the parent theme. So, I had added my custom filters and the Twenty Ten filter removal code to my child themes functions.php.</p>
<p>However, these custom filters were not being actioned. To help me debug what was happening I even added PHP error logging to check the return values from the remove_filter functions and that proved the filters were not being removed prior to mine being added <em>but</em> I still couldn&#8217;t work out why.</p>
<p>Finally by searching the WordPress forums I came across <a rel="nofollow" title="Remove continue reading from Twenty Ten" href="http://www.seanhayes.biz/goto/this_post/402/1">this post</a> and read the reply from <strong>lordarkad.</strong> It made sense. In my child theme I had to wait for the parent themes setup to finish before declaring my filter changes and this made more sense because the child themes functions.php is loaded prior to the parent themes functions.php. So whilst these filters showed in the parent theme code I was removing them <em>before</em> they had been applied and, of course, then the parent themes functions.php was applying it&#8217;s filters in the theme.</p>
<p>To fix it I followed <strong>lordarkad</strong>&#8216;s comments and created my filter additions in a child theme setup function. Then I added that function to the &#8220;after_setup_theme&#8221; action so my function is called after the parent theme has complete setup and then my filters are applied correctly.</p>
<p>This is a snippet of what I ended up with:</p>
<pre class="brush: plain; title: ; notranslate">add_action( 'after_setup_theme', 'mytheme_theme_setup' );

function mytheme_theme_setup() {
	if (!function_exists('mytheme_new_excerpt_length') ) {
		function mytheme_new_excerpt_length( $length ) {
			return 20;
		}
	}
	remove_filter( 'excerpt_length', 'twentyten_excerpt_length' );
	add_filter( 'excerpt_length', 'mytheme_new_excerpt_length' );
etc...
} // end of mytheme_theme_setup
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.seanhayes.biz/2011/adding-child-theme-filters-and-twenty-ten/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress 3.0 and flush_rewrite_rules</title>
		<link>http://www.seanhayes.biz/2010/wordpress-3-0-and-flush_rewrite_rules/</link>
		<comments>http://www.seanhayes.biz/2010/wordpress-3-0-and-flush_rewrite_rules/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 18:55:20 +0000</pubDate>
		<dc:creator>sean</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://www.seanhayes.biz/?p=376</guid>
		<description><![CDATA[I thought I would document this experience I had when upgrading some sites to WordPress 3.0. After WordPress 3.0 came out I took some time to upgrade blogs I manage and was impressed how well the upgrades fared. No issues, fair warnings and ultimately upgraded sites. However, on one of my development sites, after the [...]]]></description>
			<content:encoded><![CDATA[<p>I thought I would document this experience I had when upgrading some sites to WordPress 3.0.</p>
<p>After WordPress 3.0 came out I took some time to upgrade blogs I manage and was impressed how well the upgrades fared. No issues, fair warnings and ultimately upgraded sites. However, on one of my development sites, after the upgrade, I noted an error about &#8220;error re-declaring the function flush_rewrite_rules()&#8221;. I knew, for this site in particular, that I had written some custom code to rewrite the urls and in this case I had innocently included a function called &#8220;flush_rewrite_rules()&#8221;. Coincidentally, in WordPress 3.0 a new core function has been created called &#8220;flush_rewrite_rules()&#8221; and because that now exists my function is interfering with this and required fixing. The fix, in this case was to rename my custom function and test and I thought nothing more of it. (I know &#8211; I should have participated in the beta test).</p>
<p>I didn&#8217;t think anything of it after that until I was asked to assist with another clients site. This time the client had innocently upgraded their site to WordPress 3.0 and encountered a white screen with the long PHP error referencing &#8220;error re-declaring the function  flush_rewrite_rules()&#8221;. The difference this time was that it was in a plugin causing the issue and as such the site was rendered inaccessible.</p>
<p>For this client I connected via FTP and downloaded the plugin code, searched for the function named  &#8221;flush_rewrite_rules()&#8221; (along with any references to it) and renamed it through the code. After uploading the change the site was restored back to normal.</p>
<p>A simple fix for this site but also a simple lesson in heeding the warnings / suggestions given by the WordPress upgrade tool when upgrading to WordPress 3.0</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seanhayes.biz/2010/wordpress-3-0-and-flush_rewrite_rules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using apc (User agent is rejected)
Database Caching using apc
Object Caching 443/481 objects using apc

Served from: www.seanhayes.biz @ 2012-02-06 13:54:05 -->
