<?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>jaredeasterday.com &#187; Jared</title>
	<atom:link href="http://www.jaredeasterday.com/author/jared/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jaredeasterday.com</link>
	<description>...the home of another wordpress enthusiast</description>
	<lastBuildDate>Sat, 10 Sep 2011 19:36:27 +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>Word Camp SF 2011 Takeaways</title>
		<link>http://www.jaredeasterday.com/541/word-camp-sf-2011-takeaways/</link>
		<comments>http://www.jaredeasterday.com/541/word-camp-sf-2011-takeaways/#comments</comments>
		<pubDate>Sun, 14 Aug 2011 02:26:39 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.jaredeasterday.com/?p=541</guid>
		<description><![CDATA[This year I finally got to attend my first Word Camp, and right here in my backyard: San Francisco!  It was great to get out and mingle with so many people that are as enthusiastic about this CMS as I am.  I think one of the most interesting questions I heard asked today was one [...]]]></description>
			<content:encoded><![CDATA[<p>This year I finally got to attend my first Word Camp, and right here in my backyard: San Francisco!  It was great to get out and mingle with so many people that are as enthusiastic about this CMS as I am.  I think one of the most interesting questions I heard asked today was one asked to the Core Developer team, that went something like this: &#8220;Why is it that you&#8217;re so committed to developing for WordPress, and not one of the other various platforms out there?&#8221;  <span id="more-541"></span></p>
<p>There were a few answers from the panel, but the common theme was that it was the community that really spoke to them.  True enough; I&#8217;ve always found the community to be fantastic, so it was awesome to see and interact in meat space for once.</p>
<p>Here are some personal takeaways from <a title="WordCamp SF 2011" href="http://2011.sf.wordcamp.org/program/saturday-mission-bay/">today&#8217;s WordCamp</a>, that I hope to expand on later:</p>
<ol>
<li>Learned about Post Formats with <a title="get_post_format()" href="http://codex.wordpress.org/Function_Reference/get_post_format">get_post_format()</a>, and heard some interesting things you can do with <a title="get_template_part()" href="http://codex.wordpress.org/Function_Reference/get_template_part">get_template_part()</a>.</li>
<li>Realized I should be marking up content in better ways, such as with &lt;article&gt; and &lt;figure&gt; tags.</li>
<li>Was kind of blown away when Ian Stewart said that <a title="the_content()" href="http://codex.wordpress.org/Function_Reference/the_content">the_content()</a> is King.  If you stuff a lot of data into custom meta boxes and custom fields and your user then switches to another theme that doesn&#8217;t support those features, the content will appear &#8220;gone&#8221; to them.</li>
<li>Before implementing a custom post type, first think about using a post format.</li>
<li>Learned that I should read the <a title="WordPress Philosophy" href="http://wordpress.org/about/philosophy/">WordPress Philosophy page</a>, and understand the heuristics that Daryl Koopersmith spoke about in his talk: Decisions, Not Options.</li>
<li>Picked up a thing or two about securing widgets: iframes, <a title="Needham–Schroeder protocol" href="http://en.wikipedia.org/wiki/Needham%E2%80%93Schroeder_protocol">Needham–Schroeder protocol</a>, and <a title="xPostMessage" href="https://github.com/mdawaffe/xPostMessage">xPostMessage</a> for secure frame communication.</li>
<li>Received some advice about releasing themes into the wild, and that the <a title="WordPress Theme Review" href="http://codex.wordpress.org/Theme_Review">WordPress Theme Review page</a> and <a href="http://codex.wordpress.org/WordPress_Coding_Standards">Coding Standards page</a> are good references.</li>
<li>Realized that I should be more involved in the <a title="WordPress Forum" href="http://wordpress.org/support/">WordPress forum</a>, and should make it a goal to <a title="Contributing to WordPress" href="http://codex.wordpress.org/Contributing_to_WordPress">contribute to WordPress</a></li>
<li>Found a few new blogs I should be following: <a title="http://wpcandy.com/" href="http://wpcandy.com/">wpcandy.com</a> and <a title="ma.tt" href="http://ma.tt/">ma.tt</a></li>
<li>Learned that I should be attending the weekly IRC Dev meetups, should be paying attention to the WordPress Dev blog: <a title="WordPress Development Blog" href="http://wpdevel.wordpress.com/">wpdevel.wordpress.com</a> and should be following WordPress bugs at <a href="http://core.trac.wordpress.org/">core.trac.wordpress.org</a></li>
<li>Remembered that I should learn more about media queries and <a title="Responsive Web Design" href="http://www.alistapart.com/articles/responsive-web-design/">responsive web design</a>.</li>
<li>Confirmed that Chris Coyier of <a href="http://css-tricks.com/">CSS-tricks</a> is amazing, hilarious, now lives in the bay area, and that I want to be his friend.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.jaredeasterday.com/541/word-camp-sf-2011-takeaways/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Create, Read, and Update a Cookie using JavaScript</title>
		<link>http://www.jaredeasterday.com/530/how-to-create-read-and-update-a-cookie-using-javascript/</link>
		<comments>http://www.jaredeasterday.com/530/how-to-create-read-and-update-a-cookie-using-javascript/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 00:41:27 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.jaredeasterday.com/?p=530</guid>
		<description><![CDATA[While working on the redesign of the New York Law Journal, I was tasked with creating a pop-up message that was supposed to appear based on some logic that the business folks had.  Basically, the message was supposed to appear once per week, but no more than a total of 8 times, and then should [...]]]></description>
			<content:encoded><![CDATA[<p>While working on the redesign of the New York Law Journal, I was tasked with creating a pop-up message that was supposed to appear based on some logic that the business folks had.  Basically, the message was supposed to appear once per week, but no more than a total of 8 times, and then should never appear again.  In order to make this happen, I employed a few http cookies by way of JavaScript.<span id="more-530"></span></p>
<p>The way I ended up thinking about this was:</p>
<ol>
<li>The website visitor comes to our site, has no domain cookies, and should see the message once, but not again for another 7 days.  Our code at this point should:</li>
<ol>
<li>Show the message once</li>
<li>Set a cookie that will be responsible for showing the message once each week by expiring every 7 days. (7-day cookie)</li>
<li>Set a cookie that will be responsible for not showing the message after seeing it 8 times. (CookieCounter)</li>
</ol>
<li>Once the visitor returns to out site after 7 days, the first cookie we set should expire, and based on that we&#8217;ll:</li>
<ol>
<li>Show the message again</li>
<li>Set the 7-day cookie again</li>
<li>Update a value in the CookieCounter</li>
</ol>
<li>Once the visitor has seen the message 8 times, we won&#8217;t show it anymore, and we&#8217;ll determine this by looking at the CookieCounter value, which should have been updated each time the visitor saw that message.</li>
</ol>
<p>Using this logic, I went about coding this by first creating the 7-day Cookie, which is a self-invoking function:</p>
<pre>    (function setMyCookie(){
        var cookie = "my7DayCookie";
        var my7DayValue = 1;
        var showAgain = new Date();
        showAgain.setDate(showAgain.getDate() + 7);
        var tmp=cookie + "=" + my7DayCookie+ "; expires=" + showAgain.toGMTString() + "; path=/";
        document.cookie=tmp;
    })();</pre>
<p>Now we want to create a very similar function to create the second CookieCounter cookie:</p>
<pre>    (function setMyCounterCookie(){
        var cookie = "counterCookie";
        myCounterCookieValue = 1;
        var showAgain = new Date();
        showAgain.setDate(showAgain.getDate() + 99999);
        var tmp2=cookie + "=" + myCounterCookieValue + "; expires=" + showAgain.toGMTString() + "; path=/";
        document.cookie=tmp2;
    })();</pre>
<p>The last function we need to create is one that will find the value of a cookie:</p>
<pre>function getCookie(cookieValue) {
    var i, x, y, ARRcookies = document.cookie.split(";");
    for (i=0; i&lt;ARRcookies.length; i++) {
        x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
        y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
        x=x.replace(/^\s+|\s+$/g,"");
        if (x === cookieValue) {
            return unescape(y);
        }    
    }
}</pre>
<p>And then we assign that value to a variable by running the function and giving it the cookie we&#8217;re trying to read as a parameter:</p>
<pre>var myCounterCookieValue = getCookie("counterCookie");</pre>
<p>Now that we&#8217;ve got our two functions that will create and read our cookies for us, we need to start building out our logic and creating these cookies when appropriate.  I started this by thinking about the first state that a user would be in:  they have no cookies set and have not been to the site.  I started by writing some code that went something like this:</p>
<pre>Pseudo code: if the user has no cookies, show the message...</pre>
<p>I found however that the code for determining if there was NOT a cookie started to get messy and I began running into errors.  Instead, I flipped it upside down and started writing something like this instead:</p>
<pre>Pseudo code: if the user has both cookies, do nothing, else do something...</pre>
<p>Here&#8217;s the basic structure of what I ended up with:</p>
<pre>if (document.cookie.indexOf("my7DayCookie") &gt;= 0 &amp;&amp; document.cookie.indexOf("counterCookie") &gt;= 0){
    // Look for our cookies and if found do nothing
} else if (document.cookie.indexOf("60DayCookie") &gt;= 0 &amp;&amp; myCounterCookieValue &lt; 8){
    // if the Cookie Counter is there and it's value is less than 8, fire the message
} else if (my60DayValue &gt;= 8 ) {
    // if the Cookie Counter value is greater than 8, do nothing
} else {
    // if none of the above resolve to TRUE, then we know it's a first time visitor, so fire the message, and set both cookies.
}</pre>
<p>So, now we have a logic structure and we have our functions for creating cookies, but one final thing we need to think about is how to update the counterCookie.  It starts with a value of 1, but needs to update each time the my7DayCookie is reset.  We do this by inserting a modified version of our counterCookie creator function in the first &#8220;else if&#8221; block where we know the counterCookie exists, but the my7DayCookie does not, meaning that the user has seen the message once and the my7DayCookie has expired:</p>
<pre>    (function setMyCounterCookie(){
        var cookie = "counterCookie";
        myCounterCookieValue++;
        var showAgain = new Date();
        showAgain.setDate(showAgain.getDate() + 99999);
        var tmp2=cookie + "=" + myCounterCookieValue + "; expires=" + showAgain.toGMTString() + "; path=/";
        document.cookie=tmp2;
    })();</pre>
<p>In the above code, notice the only difference:</p>
<pre>myCounterCookieValue++;</pre>
<p>When this function runs, it will take the existing value the counterCookie holds and add 1 to it.  When we put it all together, it would look something like this:</p>
<pre>function getCookie(cookieValue) {
    var i, x, y, ARRcookies = document.cookie.split(";");
    for (i=0; i&lt;ARRcookies.length; i++) {
        x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
        y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
        x=x.replace(/^\s+|\s+$/g,"");
        if (x === cookieValue) {
            return unescape(y);
        }    
    }
}

var myCounterCookieValue = getCookie("counterCookie");

if (document.cookie.indexOf("counterCookie") &gt;= 0 &amp;&amp; document.cookie.indexOf("my7DayCookie") &gt;= 0){

    // BOTH COOKIES PRESENT, SO DO NOTHING

} else if (document.cookie.indexOf("counterCookie") &gt;= 0 &amp;&amp; myCounterCookieValue &lt; 8 ){

    // SHOW MESSAGE BY INCLUDING MESSAGE CODE HERE

    // RESET THE my7DayCookie
    (function setMy7DayCookie(){
        var cookie = "my7DayCookie";
        var my7DayCookieValue = 1;
        var showAgain = new Date();
        showAgain.setDate(showAgain.getDate() + 7);
        var tmp=cookie + "=" + my7DayCookieValue + "; expires=" + showAgain.toGMTString() + "; path=/";
        document.cookie=tmp;
    })();

    // UPDATE counterCookie, INCREASE ITS VALUE BY 1
    (function setMyCounterCookie(){
        var cookie = "counterCookie";
        myCounterCookieValue++;
        var showAgain = new Date();
        showAgain.setDate(showAgain.getDate() + 99999);
        var tmp2=cookie + "=" + myCounterCookieValue + "; expires=" + showAgain.toGMTString() + "; path=/";
        document.cookie=tmp2;
        return myCounterCookieValue;
    })();

    //console.log("counterCookie Value = " + myCounterCookieValue);

} else if (myCounterCookieValue &gt;= 8 ) {

    //DO NOTHING, THE USER HAS SEEN THE MESSAGE 8 TIMES

} else {

    // SHOW THE MESSAGE AND SET BOTH COOKIES FOR THE FIRST TIME

    (function setMyCookie(){
        var cookie = "my7DayCookie";
        var my7DayCookieValue = 1;
        var showAgain = new Date();
        showAgain.setDate(showAgain.getDate() + 7);
        var tmp=cookie + "=" + my7DayCookieValue + "; expires=" + showAgain.toGMTString() + "; path=/";
        document.cookie=tmp;
    })();

    (function setMyCounterCookie(){
        var cookie = "counterCookie";
        myCounterCookieValue = 1;
        var showAgain = new Date();
        showAgain.setDate(showAgain.getDate() + 99999);
        var tmp2=cookie + "=" + myCounterCookieValue + "; expires=" + showAgain.toGMTString() + "; path=/";
        document.cookie=tmp2;
        return myCounterCookieValue;
    })();
}</pre>
<p>I hope this was helpful!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jaredeasterday.com/530/how-to-create-read-and-update-a-cookie-using-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Issues with Git Path (git command not found)</title>
		<link>http://www.jaredeasterday.com/524/issues-with-git-path-git-command-not-found/</link>
		<comments>http://www.jaredeasterday.com/524/issues-with-git-path-git-command-not-found/#comments</comments>
		<pubDate>Fri, 15 Jul 2011 04:23:06 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://www.jaredeasterday.com/?p=524</guid>
		<description><![CDATA[I recently had to replace the hard drive on my MacBook, and the backup/restore process from my Time Machine went flawlessly.  Except for one thing: the first time I went to work on one of my projects, I received a &#8220;git: command not found&#8221; message when running &#8220;git status&#8221; in my project directory.  Git was [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to replace the hard drive on my MacBook, and the backup/restore process from my Time Machine went flawlessly.  Except for one thing: the first time I went to work on one of my projects, I received a &#8220;git: command not found&#8221; message when running &#8220;git status&#8221; in my project directory.  Git was installed, so I knew there had to be some configuration issue. After a little searching, it seemed like my path was incorrect.<span id="more-524"></span></p>
<p>On my machine, git is installed in /usr/local/git/</p>
<p>In terminal, I found that running: echo $PATH returned:</p>
<pre>/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin</pre>
<p>This didn&#8217;t look right.  After some reading, it realized I needed to make some changes to my profile to update the PATH for git.  To do this, I made sure I was in my root directory:</p>
<pre>cd ~/</pre>
<p>Then I created my profile since it didn&#8217;t seem to be there:</p>
<pre>touch .bash_profile</pre>
<p>Then I opened it using text edit:</p>
<pre>open -e .bash_profile</pre>
<p>In the file I added the following line:</p>
<pre>export PATH=/usr/local/git/bin</pre>
<p>I then restarted Terminal and once I found my development directory and ran a git status, all was well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jaredeasterday.com/524/issues-with-git-path-git-command-not-found/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To: Permanently Redirect WordPress Pages using .htaccess</title>
		<link>http://www.jaredeasterday.com/512/how-to-permanently-redirect-wordpress-pages-using-htaccess/</link>
		<comments>http://www.jaredeasterday.com/512/how-to-permanently-redirect-wordpress-pages-using-htaccess/#comments</comments>
		<pubDate>Sat, 26 Mar 2011 19:32:46 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://www.jaredeasterday.com/?p=512</guid>
		<description><![CDATA[I&#8217;m sure we&#8217;ve all been there: when you or your client launched your WordPress website you thought the best thing to title one of your pages was &#8220;Foo&#8221; or some other such silliness. After a few months you realize that a better page name would be &#8220;Bar&#8221; and you want your URL to reflect that. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sure we&#8217;ve all been there: when you or your client launched your WordPress website you thought the best thing to title one of your pages was &#8220;Foo&#8221; or some other such silliness. After a few months you realize that a better page name would be &#8220;Bar&#8221; and you want your URL to reflect that. So you login to your WordPress admin, change your &#8220;Foo&#8221; page title and slug to &#8220;Bar,&#8221; and click save. Done, right? Well, almost.<span id="more-512"></span></p>
<p>When you change a page slug, it obviously affects your URL.  Your old page used to be here:</p>
<p>http://www.yourdomain.com/foo</p>
<p>&#8230;and your new page is here:</p>
<p>http://www.yourdomain.com/bar</p>
<p>However, if you were to actually type your old address into your browser, you&#8217;re going to get a 404 Page Not Found Error. This matters because there are probably all sorts of references out there (in google&#8217;s search results, in your own website, on other websites, etc.) to http://www.yourdomain.com/foo, and you don&#8217;t want anyone who clicks on one of those links to get an error message.  You want them to go to your new URL: http://www.yourdomain.com/bar.</p>
<p>To do this, you&#8217;ll need access to the root folder of your WordPress install.  Make sure that whatever application you&#8217;re using can view hidden files, and look for the &#8220;.htaccess&#8221; file. Hopefully WordPress will have already automatically created one for you, but if not go ahead and create one.  Here&#8217;s an example of what the WordPress .htaccess file might look like:</p>
<pre># BEGIN WordPress
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
&lt;/IfModule&gt;
# END WordPress</pre>
<p>Leave this bit of code there, and let&#8217;s go ahead do a Permanent 301 Redirect from your old page to your new page.  To do this, in our example, simply add the following line of code:</p>
<pre>Redirect 301 /foo http://www.yourdomain.com/bar/</pre>
<p>Now, if you save the file and then try to go to the &#8220;/foo&#8221; page, your browser should redirect your automatically to the &#8220;/bar&#8221; page.  When search engines crawl your site, they&#8217;ll update their records with this information as well.</p>
<p>Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jaredeasterday.com/512/how-to-permanently-redirect-wordpress-pages-using-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to create a custom single.php Template in WordPress</title>
		<link>http://www.jaredeasterday.com/497/how-to-create-a-custom-single-php-template/</link>
		<comments>http://www.jaredeasterday.com/497/how-to-create-a-custom-single-php-template/#comments</comments>
		<pubDate>Thu, 17 Mar 2011 18:58:34 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.jaredeasterday.com/?p=497</guid>
		<description><![CDATA[Have you ever needed or wanted to create a custom single.php template that would only be used by posts of a certain type?  When I was building the FARMcurious site I needed a way to display blog posts and product posts in different ways.  The products single template needed to show price, product info, photos, [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever needed or wanted to create a custom single.php template that would only be used by posts of a certain type?  When I was building the FARMcurious site I needed a way to display blog posts and product posts in different ways.  The products single template needed to show price, product info, photos, and be laid out differently than blog post single template.<span id="more-497"></span></p>
<p>After looking around the WordPress community for a bit I found numerous plugins that seemed like they would do the trick, but I really hate throwing plugins at a problem unless there&#8217;s a very compelling reason to do so.  After awhile though, I found a <a href="http://elliotjaystocks.com/blog/tutorial-multiple-singlephp-templates-in-wordpress/" target="_blank">post on elliotjaystocks.com</a> that immediately made sense, and the solution is dead simple.</p>
<p>Simply put: you just need your single.php file to make a few decisions for you.  A simple if statement will help determine which category the post is in, and once you know that you can build the single.php template by including other (custom) templates.</p>
<p>The first thing you want to do is copy the code in your single.php file and save it as two new files that we&#8217;ll call using single.php.  I named mine &#8220;default-single.php&#8221; and &#8220;product-single.php&#8221;.</p>
<p>Now, in our original single.php file, delete all of the code and replace it with something like below:</p>
<pre>&lt;?php
/*
Template: single.php
*/
get_header();
?&gt;

&lt;?php
   if ( in_category( array( '6', '11' ) )) {
      include(TEMPLATEPATH.'/default-single.php');
   }
   else {
      include(TEMPLATEPATH.'/product-single.php');
   }
?&gt;</pre>
<p>The first php block simply names the template and of course the get_header(); function grabs the header.php file.</p>
<p>The next php block starts an if statement, and in this example we&#8217;re looking for posts that are in a certain array of category IDs: 6 and 11.  If there are any posts in those categories, we&#8217;re going include the code from the default-single.php file.  Otherwise, the else statement will include the code from the product-single.php file.</p>
<p>In this manner you can customize your two new single.php templates any way you like, and utilize them by simply categorizing your posts appropriately.</p>
<p>I hope this comes in handy! Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jaredeasterday.com/497/how-to-create-a-custom-single-php-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting started with git</title>
		<link>http://www.jaredeasterday.com/477/getting-started-with-git/</link>
		<comments>http://www.jaredeasterday.com/477/getting-started-with-git/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 00:58:08 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.jaredeasterday.com/?p=477</guid>
		<description><![CDATA[Up until a few months ago, I never really needed to bother myself with a Version Control System (VCS).  For freelance work, things were simple enough to the point where I&#8217;d 1) Develop a website locally and then 2) Upload code to the server, and that was pretty much the end of it.  At the [...]]]></description>
			<content:encoded><![CDATA[<p>Up until a few months ago, I never really needed to bother myself with a Version Control System (VCS).  For freelance work, things were simple enough to the point where I&#8217;d 1) Develop a website locally and then 2) Upload code to the server, and that was pretty much the end of it.  At the office our CMS took care of most things, and for things it didn&#8217;t cover, we&#8217;d adopted a system of making a backup of the last file and going from there.<span id="more-477"></span></p>
<p>A few things happened that changed my take on the necessities of version control.</p>
<ol>
<li>At work we upgraded our CMS, which didn&#8217;t preserve our versions when it launched, and it was hard to track exactly <em>what</em> changed when we&#8217;d make backups.</li>
<li>Freelance clients started asking for updates and changes to their sites, and I didn&#8217;t want a bunch of backup files cluttering my directories.  I also want to be able to start tracking what changes were made, rather than tracking simply that changes had been made.</li>
</ol>
<p>So in the office we starting using <a href="http://savannah.nongnu.org/projects/cvs">CVS</a>, and at home I decided to try <a href="http://git-scm.com/">Git</a>.  Because Git seems to have a steeper leaning curve for those not used to working with a command line, I want to document what I&#8217;ve learned with it.  So if you&#8217;re in need of a VCS and you&#8217;re interested in Git, perhaps this will help.  At the very least, it&#8217;ll serve as a reminder to me!  Note: you may want to familiarize yourself with some of the basics of working with the command line or terminal before proceeding.</p>
<h2>Getting Started</h2>
<p>I used <a href="http://net.tutsplus.com/tutorials/other/easy-version-control-with-git/">this great post over at Net.Tutsplus.com</a> as a guide, and it helped me tremendously.  After installing and configuring git, here&#8217;s how you set up one of your existing directories as a Git repository.</p>
<p>In my case, I have a version of WordPress installed locally that I use for development.  I want to have each theme have it&#8217;s own repository.</p>
<p>The first thing you need to do is navigate to the directory that you want to set up as a repository.  For me, that would be the theme&#8217;s directory in my local instal.</p>
<pre>cd /wordpress/wp-content/themes/myTheme</pre>
<p>Now that we&#8217;re in the directory that we want to track versions in, we need to initialize Git by typing:</p>
<pre>git init</pre>
<p>Once completed, you should see the following:</p>
<pre>Initialized empty Git repository in /wordpress/wp-content/themes/myTheme/.git/</pre>
<p>Okay, so now that we have the repository created, we need to actually commit some code to it. Do that by typing the following:</p>
<pre>git add .</pre>
<p>This will add all the files in your directory to the Git staging area. The &#8220;.&#8221; in the command means &#8220;get everything,&#8221; but you can specify what you want to add to the staging area by typing out the name of the file you&#8217;re interested in like so:</p>
<pre>git add header.php</pre>
<p>Now that we have all of our files in the staging area, we want to commit them to the repository. Remember that in this example we already have an entire code base that we want to add to the repository and that we want to modify later. Since this is our initial commit, we&#8217;ll want to indicate that in our comments. To commit with a comment on all files, type the following:</p>
<pre>git commit -m "initial commit"</pre>
<p>You should then see something like:</p>
<pre>[master (root-commit) 466ce7c] initial commit 56 files changed, 5602 insertions(+), 0 deletions(-)</pre>
<p>Which is followed by a list of all the files that were committed. At any time if you wonder what the status is of files in your repository, you can ask for the status:</p>
<pre>git status</pre>
<pre># On branch master
nothing to commit (working directory clean)</pre>
<p>Now that you have a committed repository, you can begin working on your code. Once you modify a file and save it, run the status command once again and you should see something like this:</p>
<pre># On branch master
# Changed but not updated:
# (use "git add  ..." to update what will be committed)
# (use "git checkout -- ..." to discard changes in working directory)
#
# modified: top.php
#</pre>
<p>This means that Git is aware that you&#8217;ve changed something in your file. At whatever point you&#8217;re happy with the changes you&#8217;ve made to your code, you&#8217;ll need to add it to the staging area, and then commit it as illustrated above. There&#8217;s a simple way to do both of those things at once with this command:</p>
<pre>git commit -am 'your message here'</pre>
<p>The &#8220;-am&#8221; means that you&#8217;re both adding it and want to type out a message. This way you don&#8217;t have to run two separate commands to commit a change.<br />
Well, we&#8217;ve now used most of the git commands that I&#8217;m so far familiar with. Obviously there are many more things you can do with Git, but at this point we&#8217;ve got our directory, we&#8217;ve added and then committed code, and we&#8217;re on our way to tracking our code versions!</p>
<p>As I become more familiar with Git, I&#8217;m sure I&#8217;ll write some more about it. Hope you enjoy Git!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jaredeasterday.com/477/getting-started-with-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Create a Flexible Page Template Using Custom Fields</title>
		<link>http://www.jaredeasterday.com/446/how-to-create-a-flexible-page-template-using-custom-fields/</link>
		<comments>http://www.jaredeasterday.com/446/how-to-create-a-flexible-page-template-using-custom-fields/#comments</comments>
		<pubDate>Mon, 17 Jan 2011 22:33:27 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.jaredeasterday.com/?p=446</guid>
		<description><![CDATA[While working with my friends over at Gastronaut, they asked me if I could develop a way for them to create blog pages for each of their clients on the fly.  For instance, if they acquired ACME Corp as a client, they wanted to be able to create  a new page for ACME corp that [...]]]></description>
			<content:encoded><![CDATA[<p>While working with my friends over at <a href="http://www.gastronautsf.com">Gastronaut</a>, they asked me if I could develop a way for them to create blog pages for each of their clients on the fly.  For instance, if they acquired ACME Corp as a client, they wanted to be able to create  a new page for ACME corp that would then have a list of blog posts that were only for ACME.<span id="more-446"></span></p>
<p>Typically I&#8217;d create a custom page template for the client, and then use the query posts function to find only posts categorized as &#8220;ACME.&#8221;  However, since their clientele are growing, I didn&#8217;t want to have to create a new page template each time they acquired new business. Besides, that&#8217;s just too many page templates!  I searched around for what other wordpress developers might have done and surprisingly I didn&#8217;t find much.</p>
<p>So, here&#8217;s what I did:</p>
<p>I made a new page template and at the top I created a variable called $clientCategory and set its value to the &#8220;client&#8221; custom field value for the page in question. In our example, the client would create a page and using a custom field on the page, they&#8217;d type in &#8220;ACME.&#8221;</p>
<pre>&lt;?php $clientCategory = get_post_meta($post-&gt;ID, 'client', true); ?&gt;</pre>
<p>So at this point in our example, the $clientCategory variable value is  &#8221;ACME.&#8221;</p>
<p>Next, I use the global $query_string variable in order to find posts that aren&#8217;t just the contents of the page in WordPress.  And then I use the query_posts function to find all posts that have a category name equal to the value set in the page&#8217;s &#8220;client&#8221; custom field.  To do this, I concatenate the $clientCategory variable that we set above to the end of the category_name argument as so:</p>
<pre>&lt;?php
   global $query_string;
   query_posts('category_name=' . $clientCategory);
?&gt;</pre>
<p>So now if the client wants to create posts for ACME and have them show up on ACME&#8217;s page, all they have to do is categorize each post as ACME.  Now of course, this means that the Category Name and the &#8220;Client&#8221; custom field value on the Page have to be exactly the same in order for this to work, but it means that the client can create these pages on the fly and I don&#8217;t need to create new page templates.</p>
<p>For example, if they want to create a page of posts for a new client &#8220;Widgets Inc.&#8221; they simply need to create a new post category &#8220;Widgets&#8221; and then create a new page that uses the new page template, and enter in &#8220;Widgets&#8221; as the &#8220;client&#8221; custom field value for the new page.</p>
<p>I hope this makes sense, and I hope it helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jaredeasterday.com/446/how-to-create-a-flexible-page-template-using-custom-fields/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gastronaut</title>
		<link>http://www.jaredeasterday.com/437/gastronaut/</link>
		<comments>http://www.jaredeasterday.com/437/gastronaut/#comments</comments>
		<pubDate>Mon, 17 Jan 2011 18:01:23 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://www.jaredeasterday.com/?p=437</guid>
		<description><![CDATA[Visit Site » The Gastronautsf.com website was designed by Adam Cahoon and launched in the fall of 2010.  Built for a good friend of ours Nate Keller and his business partner Mirit Cohen, it&#8217;s a wordpress theme that allows them to publish menus, update content at will,  and receive catering requests. Soon it will allow [...]]]></description>
			<content:encoded><![CDATA[<p><a class="button" href="http://www.gastronautsf.com">Visit Site »</a></p>
<p>The <a href="http://www.gastronautsf.com/">Gastronautsf.com</a> website was designed by Adam Cahoon and launched in the fall of 2010.  Built for a good friend of ours Nate Keller and his business partner Mirit Cohen, it&#8217;s a wordpress theme that allows them to publish menus, update content at will,  and receive catering requests.<span id="more-437"></span></p>
<p>Soon it will allow Nate and Mirit to publish private mini-blogs for each of their clients.  It was a fun project and continues to be. Check them out if you need a caterer!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jaredeasterday.com/437/gastronaut/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Heard Mentallity Version 2</title>
		<link>http://www.jaredeasterday.com/286/heard-mentallity-version-2/</link>
		<comments>http://www.jaredeasterday.com/286/heard-mentallity-version-2/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 15:55:25 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.jaredeasterday.com/?p=286</guid>
		<description><![CDATA[Version 2 is set to launch very soon, my finest wordpress theme yet!  More details soon.]]></description>
			<content:encoded><![CDATA[<p><a class="button" href="http://www.heardmentallity.com">Visit Site »</a></p>
<p>I&#8217;m very happy to announce that a new version of the Heard Mentallity theme has been launched!</p>
<p>Coded from the ground up, Version 2 features <em>much</em> more flexibility in terms of integration into WordPress. <span id="more-286"></span></p>
<p>The theme is lighter, faster, and has a much smoother user experience than did version 1.  Design-wise, it stays in the same &#8216;messages on a cork board&#8217; style, but includes numerous improvements to the overall aesthetics, and even takes advantage of a little bit of CSS3.  Version 2 was built with growth in mind, and I&#8217;m excited to see the theme&#8217;s flexibility shine as new authors join the ranks <a title="Heard Mentallity" href="http://www.heardmentallity.com">Heard Mentallity</a>.</p>
<p>The first version of Heard Mentallity was my very first WordPress theme, and as such, it wasn&#8217;t quite built in way themes should be.  It didn&#8217;t take advantage of a number of default WordPress functions, and as such many of the http references were absolute and hard coded.  Other mistakes were made as well, but instead of going into too much detail, let&#8217;s just say that this new version allows the site owner to update nearly every piece of content on the site and is built the way themes were meant to be built.</p>
<p><strong>Some of the new features are:</strong></p>
<ol>
<li>Flexible Navigation: the horizontal navigation is comprised of pages, and authors.  When the site owner wants to add a page or add another author, those pages and authors will show up in the navigation without any modification to the theme files.</li>
<li>Blog header and and tag line are now configurable by the site owner, rather than being unchangeable images.</li>
<li>Author pages will pull editable information about that author and keep it stuck to the top of each page.</li>
<li>Gravitars have been implemented, so if you have one, it will show up in the comments section!</li>
<li>Facebook share button has been added to posts to easily share music with friends.</li>
<li>The songs listed in the sidebar from Hype Machine are now pulled from an RSS feed and link directly to the song on Hype Machine.  The first version utilized a generated image and simply linked to the site owner&#8217;s page.</li>
<li>Caching has been implemented via the Wordress plugin <a title="WP Super Cache" href="http://ocaoimh.ie/wp-super-cache/">WP Super Cache</a>, which speeds up load times dramatically.</li>
</ol>
<p>Creating the theme was a lot of fun, and I learned a <em>lot!</em> There are a lot of things that I&#8217;ll be improving in future themes, but I&#8217;m really happy with the way this one came out.  I&#8217;d be happy to hear about any suggestions you may have, so feel free to share.</p>
<p>Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jaredeasterday.com/286/heard-mentallity-version-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Persephone – A Musical Allegory</title>
		<link>http://www.jaredeasterday.com/278/persephone-a-musical-allegory/</link>
		<comments>http://www.jaredeasterday.com/278/persephone-a-musical-allegory/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 06:26:05 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://www.jaredeasterday.com/?p=278</guid>
		<description><![CDATA[Visit Site » When David Hoffman requested a web site for his portfolio site, he also requested a site for his current project: Persephone, a Musical Allegory.  Because this needed to completed in time for the musical&#8217;s debut, we both sat down one weekend and pounded it out. The layout of the site is a [...]]]></description>
			<content:encoded><![CDATA[<p><a class="button" href="http://www.persephoneonstage.com/">Visit Site »</a></p>
<p>When David Hoffman requested a web site for his <a title="Creative Work by David Hoffman" href="http://www.workbydavidhoffman.com">portfolio site</a>, he also requested a site for his current project: Persephone, a Musical Allegory.  Because this needed to completed in time for the musical&#8217;s debut, we both sat down one weekend and pounded it out.<span id="more-278"></span></p>
<p>The layout of the site is a bit unconventional, and this is partly because we didn&#8217;t have a lot of time to dedicate to design.  It&#8217;s also partly because of some specific desires on the part of the client. However, for a weekender website, I think it&#8217;s not bad at all!</p>
<p><strong>Features:</strong></p>
<ol>
<li>Integration with <a title="CushyCMS" href="http://www.cushycms.com/">CushyCMS</a>, a very simple system that allows the client to update most sections of the site.</li>
<li>Utilization of the <a title="Yahoo Media Player" href="http://mediaplayer.yahoo.com/">Yahoo! Media Player</a>, which scrapes the page for audio files and plays them in a  media player.  Pause / Play buttons are automatically inserted in front of audio links for direct interactions with the links themselves, and all audio files are also placed in a play list that allows continuous play of all audio on the page.</li>
</ol>
<p>This site is pretty straight forward, but it seems to do exactly what it needs to do.  Furthermore,  it was fun to see what could be done in a single weekend.  Hope you like it.</p>
<p>Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jaredeasterday.com/278/persephone-a-musical-allegory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	<a href="http://www.wirtualnyswidwin.pl/marecki.php?date=56"><!-- Private Link --></a></channel>
</rss>

