<?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>Cory Mathews</title>
	<atom:link href="http://corymathews.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://corymathews.com</link>
	<description>Things I should remember and then some...</description>
	<lastBuildDate>Mon, 20 May 2013 14:12:48 +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>WordPress &#8211; Contact Form 7 Send Error</title>
		<link>http://corymathews.com/wordpress-contact-form-7-send-error/</link>
		<comments>http://corymathews.com/wordpress-contact-form-7-send-error/#comments</comments>
		<pubDate>Mon, 18 Feb 2013 19:26:06 +0000</pubDate>
		<dc:creator>CoryMathews</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://corymathews.com/?p=1042</guid>
		<description><![CDATA[I was getting the message "Failed to send your message. Please try later or contact administrator by other way" in a red bordered box when trying to submit a wordpress form using Contact Form 7 plugin. There are many, many ways this vague error message can be displayed. You could try installing an SMTP plugin [...]]]></description>
				<content:encoded><![CDATA[<p>I was getting the message</p>
<pre>"Failed to send your message. Please try later or contact administrator by other way"</pre>
<p>in a red bordered box when trying to submit a wordpress form using Contact Form 7 plugin. There are many, many ways this vague error message can be displayed.</p>
<p>You could try installing an SMTP plugin as mentioned on a ton of sites.</p>
<p>Maybe you need to change the name of the address it is being sent from as mentioned by <a href="http://www.technoreply.com/fix-failed-to-send-your-message-please-try-later-or-contact-administrator-by-other-way/">jevin</a>.</p>
<p>Or as it was in my case someone put multiple email addresses and separated them with a semicolon instead of a comma and did not test the form. When putting multiple email addresses in the to field of the form you must be in the format</p>
<pre>example@example.com, example@example.com</pre>
]]></content:encoded>
			<wfw:commentRss>http://corymathews.com/wordpress-contact-form-7-send-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Importing Textpattern to WordPress 3.5</title>
		<link>http://corymathews.com/importing-textpattern-to-wordpress-3-5/</link>
		<comments>http://corymathews.com/importing-textpattern-to-wordpress-3-5/#comments</comments>
		<pubDate>Thu, 31 Jan 2013 21:41:25 +0000</pubDate>
		<dc:creator>CoryMathews</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[textpatter]]></category>

		<guid isPermaLink="false">http://corymathews.com/?p=1034</guid>
		<description><![CDATA[I was looking to import an old site running Textpattern v4.2.0 to WordPress 3.5.1. I found this crappy plugin which never worked. So I had to find another easy way. RSS should work. It appeared the Textpattern site never had an RSS feed so to create one I went to Presentations &#62; Pages &#62; and created [...]]]></description>
				<content:encoded><![CDATA[<p>I was looking to import an old site running Textpattern v4.2.0 to WordPress 3.5.1. I found <a href="http://wordpress.org/extend/plugins/textpattern-importer/">this crappy plugin</a> which never worked. So I had to find another easy way.</p>
<p>RSS should work.</p>
<p>It appeared the Textpattern site never had an RSS feed so to create one I went to Presentations &gt; Pages &gt; and created one called rss and added the content</p>
<p><code>&lt;txp:feed_link section="" category="" limit="1000"/&gt;</code></p>
<p>Then if you go to yourdomain.com/rss you will hopefully get all the posts from your site.</p>
<p>Save that file to your comp and open up wordpress.</p>
<p>In wordpress go to Tools &gt; Import &gt; RSS &gt; Install the Plugin</p>
<p>Then select the feed file you saved and it will add all the posts to wordpress for you.</p>
<p>This won&#8217;t import anything except the content of the post so if the plugin would have worked it would have been a lot nicer, but it got the content from textpattern into wordpress.</p>
]]></content:encoded>
			<wfw:commentRss>http://corymathews.com/importing-textpattern-to-wordpress-3-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress 3.5 Media and Visual/Text Buttons No Longer Work</title>
		<link>http://corymathews.com/wordpress-3-5-media-and-visualtext-buttons-no-longer-work/</link>
		<comments>http://corymathews.com/wordpress-3-5-media-and-visualtext-buttons-no-longer-work/#comments</comments>
		<pubDate>Mon, 21 Jan 2013 15:57:58 +0000</pubDate>
		<dc:creator>CoryMathews</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://corymathews.com/?p=1018</guid>
		<description><![CDATA[I recently updated to wordpress 3.5 and the add media button as well as the visual/text buttons stopped working when editing a page. Here is how to fix it. Download your wp-config.php file through ftp and add the line: define('CONCATENATE_SCRIPTS', false); Just before the lines: /** Sets up WordPress vars and included files. */ require_once(ABSPATH [...]]]></description>
				<content:encoded><![CDATA[<p>I recently updated to wordpress 3.5 and the add media button as well as the visual/text buttons stopped working when editing a page. Here is how to fix it.</p>
<p>Download your wp-config.php file through ftp and add the line:</p>
<p><code>define('CONCATENATE_SCRIPTS', false);</code></p>
<p>Just before the lines:</p>
<p><code>/** Sets up WordPress vars and included files. */<br />
require_once(ABSPATH . 'wp-settings.php');</code></p>
<p>and that should fix the problem until its properly fixed in wordpress.</p>
]]></content:encoded>
			<wfw:commentRss>http://corymathews.com/wordpress-3-5-media-and-visualtext-buttons-no-longer-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HostGator WordPress Emails Not Being Received By All Email Addresses</title>
		<link>http://corymathews.com/hostgator-wordpress-emails-not-being-received-by-all-email-addresses/</link>
		<comments>http://corymathews.com/hostgator-wordpress-emails-not-being-received-by-all-email-addresses/#comments</comments>
		<pubDate>Thu, 17 Jan 2013 20:33:58 +0000</pubDate>
		<dc:creator>CoryMathews</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://corymathews.com/?p=1015</guid>
		<description><![CDATA[I was working with a hostgator shared hosting account and had created a simple contact form using a wordpress plugin. In testing I was sending it to my gmail and work email accounts. Everything worked as expected. Upon production I started sending it to the clients email which has the same domain as the site [...]]]></description>
				<content:encoded><![CDATA[<p>I was working with a hostgator shared hosting account and had created a simple contact form using a wordpress plugin. In testing I was sending it to my gmail and work email accounts.  Everything worked as expected. Upon production I started sending it to the clients email which has the same domain as the site but hosted on google apps instead of hostgator. </p>
<p>The client would never receive the emails.</p>
<p>Turns out that within cpanel the <strong>MX record must be changed to &#8220;Remote Mail Exchanger&#8221;</strong> instead of the default &#8220;Automatically Detect Configuration (recommended)&#8221; which despite its name did not automatically detect the correct configuration. </p>
<p>I try to never mess with email related items and do not have a detailed explanation as to why. But I know I will forget this next time it happens, so I best write it down.</p>
]]></content:encoded>
			<wfw:commentRss>http://corymathews.com/hostgator-wordpress-emails-not-being-received-by-all-email-addresses/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Figuring Out Connection Pool Errors</title>
		<link>http://corymathews.com/figuring-out-connection-pool-errors/</link>
		<comments>http://corymathews.com/figuring-out-connection-pool-errors/#comments</comments>
		<pubDate>Mon, 01 Oct 2012 20:41:02 +0000</pubDate>
		<dc:creator>CoryMathews</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://corymathews.com/?p=955</guid>
		<description><![CDATA[This is the error I had to go on. System.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached. It sounds pretty obvious that it is a database connection that was not being [...]]]></description>
				<content:encoded><![CDATA[<p>This is the error I had to go on.</p>
<blockquote><p>System.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.</p></blockquote>
<p>It sounds pretty obvious that it is a database connection that was not being closed. But I have hundreds of points of connection in my webapp. How do I figure out which one I am forgetting to close?</p>
<p>First exec </p>
<pre>sp_who2 </pre>
<p>on sql server and look at all those connections, now find a bunch connected to your database with the status &#8220;sleeping&#8221; and the command &#8220;AWAITING COMMAND&#8221;. They also give you the SPID which comes in very handy.</p>
<p>Take the SPID and run it in <a href="http://technet.microsoft.com/en-us/library/ms187730(SQL.90).aspx" target="_blank">dbcc inputbuffer()</a></p>
<pre>dbcc inputbuffer(SPID)</pre>
<p>This will tell you the command that was last run by that process id, then all you have to do is find that query or stored procedure in your apps code and make sure you close the connection.</p>
<h2>Deeper Problems</h2>
<p>This can be a symptom of a larger problem with your database connection class. You should not have to manually close a connection every time you connect.</p>
<p>SqlConnection uses the <a href="http://msdn.microsoft.com/en-us/library/system.idisposable.aspx" target="_blank">iDisposable</a> interface so wrap your connection statement in a <a href="http://msdn.microsoft.com/en-us/library/yh598w02.aspx" target="_blank">using</a> statement. When a SqlConnection is disposed it is also closed so simplify and let .net take care of it for you.</p>
<pre>using (SqlConnection connection = new SqlConnection(connectionString))
{
....
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://corymathews.com/figuring-out-connection-pool-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Custom Events</title>
		<link>http://corymathews.com/jquery-custom-events/</link>
		<comments>http://corymathews.com/jquery-custom-events/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 19:01:23 +0000</pubDate>
		<dc:creator>CoryMathews</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://corymathews.com/?p=872</guid>
		<description><![CDATA[We are used to javascript events such as a &#8220;click&#8221; being handled similar to the following: $('#id').on("click", function() { alert("Item clicked"); }); But less common is the use of custom events available with the .trigger() and .triggerHandler() jQuery functions. With this I could create an event such as &#8220;cory.says.hello&#8221;, if I so wished and then [...]]]></description>
				<content:encoded><![CDATA[<p>We are used to javascript events such as a &#8220;click&#8221; being handled similar to the following:</p>
<pre>
$('#id').on("click", function() {
    alert("Item clicked");
});
</pre>
<p>But less common is the use of custom events available with the <a href="http://api.jquery.com/trigger/">.trigger()</a> and <a href="http://api.jquery.com/triggerHandler/">.triggerHandler()</a> jQuery functions. With this I could create an event such as &#8220;cory.says.hello&#8221;, if I so wished and then handle it with </p>
<pre>
$('#id').on("cory.says.hello", function() {
    alert("Hello Cory");
});
</pre>
<h2> Usage</h2>
<p>So you are writting a lightbox plugin (or whatever plugin really), and you want to give anyone the ability to add additional logic when the lightbox opens. Of the many ways to allow them to do this an easy way is to create a custom event for them to handle.</p>
<p>So continuing with the lightbox example, you could add an event when you open the lightbox with something like:</p>
<pre>
function open() {
  //blah
  $('#id')triggerHandler({ type:"lightbox.open" });
  //more
}
</pre>
<p>which could then later be caught by anyone using your plugin like so:</p>
<pre>
$(function() {
  $('#id').on("lightbox.open", function() {
    alert("The lightbox just opened. Woo!");
  });
});
</pre>
<p>Nice and simplistic. What about passing variables to the event handler? Maybe I want to run an event on an ajax response or whatever the case may be. </p>
<pre>
  $('#id').triggerHandler({ 
    type:"lightbox.open",
    var1:'Howdy',
    information:'I could pass something here also'
  });
</pre>
<p>Then to get the var1, and information data out of the previous example we would do:</p>
<pre>
$(function() {
  $('#id').on("lightbox.open", function(o) {
    alert(o.var1 + " - " + o.information);
  });
});
</pre>
<h2>Differences between .trigger() and .triggerHandler()</h2>
<p>The differences between the two are pretty small, but still important. To quote the jQuery Docs:</p>
<blockquote><p>
The .triggerHandler() method behaves similarly to .trigger(), with the following exceptions:</p>
<ul>
<li>The .triggerHandler() method does not cause the default behavior of an event to occur (such as a form submission).</li>
<li>While .trigger() will operate on all elements matched by the jQuery object, .triggerHandler() only affects the first matched element.</li>
<li>Events created with .triggerHandler() do not bubble up the DOM hierarchy; if they are not handled by the target element directly, they do nothing.</li>
<li>Instead of returning the jQuery object (to allow chaining), .triggerHandler() returns whatever value was returned by the last handler it caused to be executed. If no handlers are triggered, it returns undefined</li>
</ul>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://corymathews.com/jquery-custom-events/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using Quartz.Net to Create Scheduled Tasks</title>
		<link>http://corymathews.com/using-quartz-net-to-create-scheduled-tasks/</link>
		<comments>http://corymathews.com/using-quartz-net-to-create-scheduled-tasks/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 16:07:50 +0000</pubDate>
		<dc:creator>CoryMathews</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C Sharp]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://corymathews.com/?p=854</guid>
		<description><![CDATA[These steps are using version 1.0.3, and do not apply to version 2.x Quartz.Net is a full-featured, open source job scheduling system. Basically this system allows an asp.net web application to schedule and run background jobs. This makes it much simpler for us developers by making it so that we do not have to have [...]]]></description>
				<content:encoded><![CDATA[<p><em>These steps are using version 1.0.3, and do not apply to version 2.x</em></p>
<p><a href="http://quartznet.sourceforge.net/" title="Quartz.Net">Quartz.Net</a> is a full-featured, open source job scheduling system. Basically this system allows an asp.net web application to schedule and run background jobs. This makes it much simpler for us developers by making it so that we do not have to have a windows service running on the server as well. </p>
<p>To get started open up the NuGet package manager. (right click on the projects name, and select Manage NuGet Packages) Search for Quartz and click install. This will add the needed references as well as download the Common.Logging dependency if needed.</p>
<p>Now to the code, we need to create our Job which will be run by the scheduler. This class must use the IJob interface provided from Quartz.Net. </p>
<pre>
...
using Quartz;
using Quartz.Impl;
...

public class DailyJob : IJob
{
    public DailyJob() { }

    public void Execute( JobExecutionContext context )
    {
        try {
            //Your Logic
        } catch( Exception e ) {
            //Handle this please
        }
    }

    public static void ScheduleJob( IScheduler sc ) 
    { 
        JobDetail job = new JobDetail( "Send", "Daily", typeof( DailyJob ) );
        sc.ScheduleJob( job, TriggerUtils.MakeDailyTrigger( "trigger1", 8, 15 ) );
        sc.Start();
    }
}
</pre>
<p>The code placed in the Execute function is obviously what will run when the job is executed at its scheduled time. If you fail to add the try/catch block then the code can silently fail without being caught by a global error handler since there is no http request present. The ScheduleJob function is not required by the IJob interface but seems more logical to me, so it is added as well. </p>
<p>The Scheduling function above creates a new job Daily.Send (thats GroupName.TaskName ) and schedules it to run daily at 8:15am (14, 15 would be 2:15pm). You can replacing the TriggerUtils.MakeDailyTrigger with how often you want the Job to run, such as every 20 minutes, every hour, etc. </p>
<p>Lastly we need to call this Schedule function from the Global.asax Application_Start function so that when our app starts the code is automatically scheduled.</p>
<pre>
DailyJob.ScheduleJob( new StdSchedulerFactory().GetScheduler() );
</pre>
]]></content:encoded>
			<wfw:commentRss>http://corymathews.com/using-quartz-net-to-create-scheduled-tasks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>EventType clr20r3, P1 w3wp.exe &#8211; system.nullreferenceexception</title>
		<link>http://corymathews.com/eventtype-clr20r3-p1-w3wp-exe-system-nullreferenceexception/</link>
		<comments>http://corymathews.com/eventtype-clr20r3-p1-w3wp-exe-system-nullreferenceexception/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 20:07:30 +0000</pubDate>
		<dc:creator>CoryMathews</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://corymathews.com/?p=838</guid>
		<description><![CDATA[My web app was crashing every few minutes, logging everyone off and completely restarting. Here was the message I had to go on and how I fixed it. Event Type: Error Event Source: .NET Runtime 2.0 Error Reporting Event Category: None Event ID: 5000 Date: ****** Time: ******* User: N/A Computer: ******* Description: EventType clr20r3, [...]]]></description>
				<content:encoded><![CDATA[<p>My web app was crashing every few minutes, logging everyone off and completely restarting. Here was the message I had to go on and how I fixed it.</p>
<blockquote><p>Event Type: Error<br />
Event Source: .NET Runtime 2.0 Error Reporting<br />
Event Category: None<br />
Event ID: 5000<br />
Date: ******<br />
Time: *******<br />
User: N/A<br />
Computer: *******<br />
Description:<br />
EventType clr20r3, P1 w3wp.exe, P2 6.0.3790.3959, P3 *******, P4 *******, P5 1.0.0.0, P6 *******, P7 3b6, P8 c2, P9 system.nullreferenceexception, P10 NIL.</p>
<p>For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.</p></blockquote>
<p>This was found in my Windows Application Error Log. Basically I had a system.nullreferenceexception somewhere in my application that was causing the ENTIRE application to restart. Fucking retarded, but according to <a href="http://support.microsoft.com/kb/911816">this KB</a></p>
<blockquote><p>&#8220;ASP.NET uses the default policy for unhandled exceptions in the .NET Framework 2.0. <strong>When an unhandled exception is thrown, the ASP.NET-based application unexpectedly quits</strong>.</p>
<p>This behavior does not apply to exceptions that occur in the context of a request. These kinds of exceptions are still handled and wrapped by an HttpException object. Exceptions that occur in the context of a request do not cause the worker process to end. However,<strong> unhandled exceptions outside the context of a request, such as exceptions on a timer thread or in a callback function, cause the worker process to end.</strong>&#8221;</p>
<p>&#8220;This behavior is by design.&#8221;</p></blockquote>
<p>So now I know that I have an error in code that runs behind the scenes. But without some direction good luck ever figuring out the problem, which is where this nasty cryptic error message above comes into play.</p>
<p>The key items are the P1 &#8211; P10 specifically p7. According to <a href="http://www.netframeworkdev.com/common-language-runtime/clr20r3-from-a-windows-service-calling-a-dot-net-dll-32830.shtml">this article on clr20r3</a> (notice clr20r3 was given before the P1 for EventType)</p>
<blockquote><p>P1: Application Name<br />
P2: Application version<br />
P3: Application time stamp<br />
P4: Assembly/Module name<br />
P5: Assembly/Module version<br />
p6: Assembly/Module timestamp<br />
<strong>P7: MethodDef</strong><br />
p8: IL offset<br />
p9: Exception name (Hashed because the name is too long )</p></blockquote>
<p>So in my error above p7 is 3b6. Now comes the fun part. Open up IL Disassembler (comes with visual studio under the SDK tools)</p>
<ol>
<li>Go to File &gt; Open and select the .dll the error is happening in (the P4 from the error message)</li>
<li>View &gt; Meta Info &gt; Show!</li>
<li>Find and type in 06000 and your p7 so in this case 060003b6</li>
<li>You should see something like the picture below. If you scroll up the page it will say class and you should be able to narrow down the function causing the error from there.</li>
</ol>
<p><a href="http://corymathews.com/wp-content/uploads/2011/12/ILDisassembler.png"><img class="size-medium wp-image-839" title="ILDisassembler" src="http://corymathews.com/wp-content/uploads/2011/12/ILDisassembler-300x128.png" alt="" width="300" height="128" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://corymathews.com/eventtype-clr20r3-p1-w3wp-exe-system-nullreferenceexception/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>HTML5 Placeholder in IE and Unsupported Browsers</title>
		<link>http://corymathews.com/html5-placeholder-in-ie/</link>
		<comments>http://corymathews.com/html5-placeholder-in-ie/#comments</comments>
		<pubDate>Fri, 09 Dec 2011 19:50:00 +0000</pubDate>
		<dc:creator>CoryMathews</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://corymathews.com/?p=819</guid>
		<description><![CDATA[The html5 placeholder attribute on an input tag is a really nice, however easily adding that feature to older IE versions and any other browsers that don&#8217;t support it renders it unusable in production. The below javascript/jquery code will check the page for any inputs with the placeholder attribute and make it work in browsers [...]]]></description>
				<content:encoded><![CDATA[<p>The html5 placeholder attribute on an input tag is a really nice, however easily adding that feature to older IE versions and any other browsers that don&#8217;t support it renders it unusable in production.</p>
<p>The below javascript/jquery code will check the page for any inputs with the placeholder attribute and make it work in browsers that do not support it, and it will do nothing in those that do.</p>
<pre>
(function($) {
  $.fn.placeholder = function() {
    if(typeof document.createElement("input").placeholder == 'undefined') {
      $('[placeholder]').focus(function() {
        var input = $(this);
        if (input.val() == input.attr('placeholder')) {
          input.val('');
          input.removeClass('placeholder');
        }
      }).blur(function() {
        var input = $(this);
        if (input.val() == '' || input.val() == input.attr('placeholder')) {
          input.addClass('placeholder');
          input.val(input.attr('placeholder'));
        }
      }).blur().parents('form').submit(function() {
        $(this).find('[placeholder]').each(function() {
          var input = $(this);
          if (input.val() == input.attr('placeholder')) {
            input.val('');
          }
      })
    });
  }
}
})(jQuery);
</pre>
<p>Line 3 of the javascript checks if the browser supports the placeholder attribute and only runs if it does not.</p>
<p>To call this plugin just add the following to your page.</p>
<pre>$.fn.placeholder();</pre>
<p>You may also want to add the following css to make it more like the browsers that do support it.</p>
<pre>.placeholder { color: #aaa; }</pre>
<p><em>The original bulk of this code was written by <a href="http://www.hagenburger.net/BLOG/HTML5-Input-Placeholder-Fix-With-jQuery.html">Nico Hagenburger</a>. I basically only added the support check and turned it into a plugin.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://corymathews.com/html5-placeholder-in-ie/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>List Current Parent and Child Pages in WordPress</title>
		<link>http://corymathews.com/list-current-parent-and-child-pages-in-wordpress/</link>
		<comments>http://corymathews.com/list-current-parent-and-child-pages-in-wordpress/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 20:19:16 +0000</pubDate>
		<dc:creator>CoryMathews</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://corymathews.com/?p=805</guid>
		<description><![CDATA[Recently in WordPress I needed to create a navigation that would display a page&#8217;s parent page and all of that pages children, I am a bit rusty with PHP but here is what I got to work. If you need to order the posts by the order value change the $pages = Line to $pages [...]]]></description>
				<content:encoded><![CDATA[<p>Recently in WordPress I needed to create a navigation that would display a page&#8217;s parent page and all of that pages children, I am a bit rusty with PHP but here is what I got to work.</p>
<pre>
<ul>
<?php 
  if($post->post_parent == 0) { 
    $pageLinkID = $post->ID;
    $title = $post->post_title;
  } else {
    $pageLinkID = $post->post_parent;
    $title = get_the_title($post->post_parent);
  }
  echo '<li class="parent"><a href="'.get_page_link($pageLinkID).'">'.$title.'</a></li>';
  $pages = get_pages('child_of='.$pageLinkID);
  foreach ($pages as $p) {
    echo '<li><a href="'.get_page_link($p->ID).'">'.$p->post_title.'</a></li>';
  }
?>
</ul>
</pre>
<p>If you need to order the posts by the order value change the <code>$pages = </code> Line to </p>
<pre>$pages = get_pages('child_of='.$pageLinkID.', 'sort_column' => 'menu_order', 'sort_order' => 'asc');</pre>
]]></content:encoded>
			<wfw:commentRss>http://corymathews.com/list-current-parent-and-child-pages-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
