<?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>Envex Labs</title>
	<atom:link href="http://envexlabs.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://envexlabs.com</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Thu, 01 Dec 2011 02:25:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>ArtFork</title>
		<link>http://envexlabs.com/2011/11/artfork/</link>
		<comments>http://envexlabs.com/2011/11/artfork/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 20:05:51 +0000</pubDate>
		<dc:creator>envex</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[artfork]]></category>

		<guid isPermaLink="false">http://envexlabs.com/?p=147</guid>
		<description><![CDATA[ArtFork is a community for people who love art. Plain and simple.]]></description>
			<content:encoded><![CDATA[<p>Last week (American Thanksgiving Weekend 2011 &#8212; I case this post is super old), <a href="http://sirmikeofmitchell.com/">Mike Mitchell</a> and I launched <strong><a href="http://artfork.com">ArtFork</a></strong>.</p>
<h2>WTF is ArtFork?</h2>
<p><strong>ArtFork</strong> is a community for people who love art. Plain and simple.</p>
<p>If you find something you like online, or something you&#8217;ve spent hours creating, you post it to the site and give others the opportunity to comment on each piece of art. The site is still young and we have tons of plans in the works to make it the best possible community we can.</p>
<p>If this sounds interesting, go ahead and check out the site: <a href="http://artfork.com">http://artfork.com</a> &#8212; Code: <strong>GETFORKED</strong></p>
<p><em>An in-depth post about the workings of ArtFork to follow.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://envexlabs.com/2011/11/artfork/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fillerama Shortcode</title>
		<link>http://envexlabs.com/2011/09/fillerama-shortcode/</link>
		<comments>http://envexlabs.com/2011/09/fillerama-shortcode/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 19:01:58 +0000</pubDate>
		<dc:creator>envex</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[shortcode]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://envexlabs.com/?p=109</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<div class="row"></p>
<p><div class="span5"></p>
<p>Filling designs/themes/templates/etc with text was a pain in the ass. Copy and pasting Lorem Ipsum 1000 times was getting a tad old. Enter <a title="Fillerama" href="http://chrisvalleskey.com/fillerama/" target="_blank">Fillerama</a>.</p>
<p>Now, you&#8217;re still doing the old copy/paste, but now you&#8217;re doing it with flare!</p>
<p>You can <a title="View Demo" href="#demo">see a working demo</a> of the shortcode lower down on the page, or you can continue reading the steps below.</p>
<h3>&#8230;..but I&#8217;m working with WordPress, is there an easier way?</h3>
<p><strong>You&#8217;re already off to a great start!</strong></p>
<p><strong>Step 1.</strong> Download the shortcode from <a href="https://raw.github.com/gist/1214924/27c4eb29db2e8ff811f71579a1a6b2b50334e8e8/fillerama_shortcode.php">Github</a> or copy and paste the code on the right. (The Github link is below)</p>
<p><strong>Step 2</strong>. Open up <code>functions.php</code> and paste that code in.</p>
<p><strong>Step 3.</strong> Goto the WordPress editor for whatever page/post you&#8217;re working on and add the <code>[fillerama]</code> shortcode.</p>
<p>Available options are <code>[fillerama paragraphs=15 show=dexter lists=yes headers=yes]</code>. <em>No options are required.</em></p>
<p>Available shows are:</p>
<ul>
<li>doctorwho</li>
<li>dexter</li>
<li>futurama</li>
<li>holygrail</li>
<li>simpsons</li>
<li>starwars</li>
</ul>
<h4>Things To Come</h4>
<p>There are a few more things I&#8217;d like to add to the shortcode that aren&#8217;t included right now.</p>
<ul>
<li><del>Ability to choose different shows</del></li>
<li><del>Set the number of paragraphs</del></li>
<li>Add lists</li>
<li>Random styling (strong, em, underline, etc)</li>
<li>Clean it up</li>
</ul>
<p></div><!-- span --></p>
<p><div class="span11"></p>
<p><div class="well"><a href="http://github.com" class="btn small primary" target="_blank">Download From Github</a><a href="http://chrisvalleskey.com/fillerama/" class="btn small other" target="_blank">Visit Fillerama</a><a href="#demo" class="btn small demo">View Demo</a></div></p>
<p><div class="github"><pre class="prettyprint linenums">&lt;?php

/*

	file_get_contents in a file_get_contents-less world

*/

function file_get_contents_curl($url) {
	$ch = curl_init();
 
	curl_setopt($ch, CURLOPT_HEADER, 0);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser.
	curl_setopt($ch, CURLOPT_URL, $url);
 
	$data = curl_exec($ch);
	curl_close($ch);
 
	return $data;
}

/*

	Fillerama

*/

function fillerama_shortcode($atts){

	/*
	
		Get the attributes
	
	*/

	extract( shortcode_atts( array(
		'show' =&gt; 'futurama',
		'paragraphs' =&gt; '5',
		'show_headers' =&gt; 'yes',
		'show_lists' =&gt; 'no'
	), $atts ) );
		
	/*
	
		Grab the information from fillerama
	
	*/
	
	$response = file_get_contents_curl('http://api.chrisvalleskey.com/fillerama/get.php?count=100&amp;format=json&amp;show=' . $show);
	
	/*
	
		No response? Quit it.
	
	*/
	
	if(!$response){
	
		return;
		
	}
	
	/*
	
		Format the response and break it up until variables
	
	*/
	
	$response = json_decode($response);
	
	$text = $response-&gt;db;
	$headers = $response-&gt;headers;
		
	$text_count = count($text);
	$header_count = count($headers);
	
	$random_limit = 10;

	/*
	
		Loop through the paragraphs
	
	*/
	
	for($i = 0; $i &lt;= $paragraphs; $i++){
		
		/*
		
			Headers
		
		*/
		
		if($show_headers == 'yes'){
		
			$head_tag = $i &lt; 4 ? 'h' . ($i + 1) : 'h5';
			
			$return .= &quot;&lt;$head_tag&gt;&quot; . $headers[rand(0, $header_count)]-&gt;header . &quot;&lt;/$head_tag&gt;&quot;;		
			
		}
		
		/*
		
			Render out the text
		
		*/
		
		for($a = 0; $a &lt;= rand(0, $random_limit); $a++){
			
			$text_return .= $text[rand(0, $text_count)]-&gt;quote . ' ';
		
			/*
			
				Randomly Input a break
			
			*/
		
			if($a == rand(0, $paragraphs)){
			
				$text_return .= '&lt;/p&gt;&lt;p&gt;';
			
			}
				
		}
		
		$return .= '&lt;p&gt;' . $text_return . '&lt;/p&gt;';
		
		$text_return = null;

	}
	
	return $return;
		
}
add_shortcode('fillerama', 'fillerama_shortcode');</pre><p class="view_raw"><a href="https://raw.github.com/gist/1214924/a9be6927996e9c05af9314512d675479889fb279/fillerama_shortcode.php" target="_blank">View Raw</a></p></div></p>
<p></div><!-- span --></p>
<p></div> <!-- row -->
<div class="well demo">
<h2>Demo</h2>
</p>
<h3 id="demo"><span class="Apple-style-span" style="font-size: 13px; font-weight: normal;"><h1>Si se puede</h1><p>Hello, Dexter Morgan. </p><p>I am not a killer. </p><h2>The Dark Defender</h2><p>Under normal circumstances, I'd take that as a compliment. I'm thinking two circus clowns dancing. You? You're a killer. I catch killers. You're a killer. I catch killers. I'm really more an apartment person. </p><p>I'm partial to air conditioning. </p><h3>Circle of Friends</h3><p>Tell him time is of the essence. I'm Dexter, and I'm not sure what I am. This man is a knight in shining armor. I'm not the monster he wants me to be. So I'm neither man nor beast. I'm something new entirely. With my own set of rules. I'm Dexter. Boo. </p><p>You look&hellip;perfect. I'm partial to air conditioning. </p><p></p><h4>Our Father</h4><p>You look&hellip;perfect. Like a sloth. I can do that. I'm doing mental jumping jacks. I think he's got a crush on you, Dex! </p><h5>The Big One</h5><p>I have a dark side, too. I'm partial to air conditioning. </p><h5>Love American Style</h5><p>He taught me a code. To survive. </p></span></h3>
<p>
</demo>
]]></content:encoded>
			<wfw:commentRss>http://envexlabs.com/2011/09/fillerama-shortcode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Github Shortcode</title>
		<link>http://envexlabs.com/2011/09/github-shortcode/</link>
		<comments>http://envexlabs.com/2011/09/github-shortcode/#comments</comments>
		<pubDate>Sat, 03 Sep 2011 17:43:41 +0000</pubDate>
		<dc:creator>envex</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Snippet]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://envexlabs.com/?p=63</guid>
		<description><![CDATA[I wanted a really easy way to include my Github files in posts without having to copy and paste over the code. Usage Grab the code from below and throw it in your file. Copy the link to the raw version of the Github file and add it to the shortcode. The only required attribute [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted a really easy way to include my Github files in posts without having to copy and paste over the code.</p>
<h2>Usage</h2>
<p>Grab the code from below and throw it in your <code>functions.php</code> file.</p>
<p>Copy the link to the raw version of the Github file and add it to the <code>[github]</code> shortcode. The only required attribute is file. lang is optional &#8212; it allows you to force the language styling.</p>
<p>ie. <code>[github file="https://raw.github.com/gist/1191517/ee7382153d40e4a07be9a5d8fc24ed373c574bcd/github_shortcode.php" lang="php"]</code></p>
<p>This will wrap your code in a <code>&lt;pre&gt;</code> tag that makes it easy to apply <a href="http://code.google.com/p/google-code-prettify/" target="_blank">Google Prettify</a>.</p>
<h2>Code</h2>
<div class="github"><pre class="prettyprint linenums">&lt;?php

/*

	file_get_contents in a file_get_contents-less world

*/

function file_get_contents_curl($url) {
	$ch = curl_init();
 
	curl_setopt($ch, CURLOPT_HEADER, 0);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser.
	curl_setopt($ch, CURLOPT_URL, $url);
 
	$data = curl_exec($ch);
	curl_close($ch);
 
	return $data;
}

/*

	Github formatter

*/

function github_shortcode($atts, $content = null) {

	if($atts['file']){
		
		$lang = $atts['lang'] ? &quot;lang-$atts[lang]&quot; : &quot;lang-html&quot;;
		
		$content = '&lt;div class=&quot;github&quot;&gt;&lt;pre class=&quot;prettyprint linenums&quot;&gt;';
		
		$get_content = file_get_contents_curl($atts['file']);

		$formatted_content = htmlspecialchars($get_content);
		
		$content .= $formatted_content;
		
		$content .= '&lt;/pre&gt;&lt;p class=&quot;view_raw&quot;&gt;&lt;a href=&quot;' . $atts['file'] . '&quot; target=&quot;_blank&quot;&gt;View Raw&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;';
		
		return $content;
		
	}

}
add_shortcode('github', 'github_shortcode');</pre><p class="view_raw"><a href="https://raw.github.com/gist/1191517/ee7382153d40e4a07be9a5d8fc24ed373c574bcd/github_shortcode.php" target="_blank">View Raw</a></p></div>
]]></content:encoded>
			<wfw:commentRss>http://envexlabs.com/2011/09/github-shortcode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Redesign</title>
		<link>http://envexlabs.com/2011/09/the-redesign/</link>
		<comments>http://envexlabs.com/2011/09/the-redesign/#comments</comments>
		<pubDate>Sat, 03 Sep 2011 17:25:11 +0000</pubDate>
		<dc:creator>envex</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://envexlabs.com/?p=59</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<div class="row"></p>
<p><div class="span5"></p>
<h2>What runs this site</h2>
<p>While the main purpose of this site is to generate clients, It also allowed me to use some new stuff I&#8217;ve been waiting to use for a while. Below are a few key features of the site:</p>
<ul>
<li>Built with <a href="http://twitter.github.com/bootstrap/" target="_blank">Bootstrap</a></li>
<li><a title="Github Shortcode" href="http://envexlabs.com/2011/09/github-shortcode/">Custom shortcode</a> that grabs a file from Github and uses Google Prettify to make it sexy</li>
<li>Custom shortcodes to deal with rows and columns</li>
<li>Ajax post navigation using <a href="http://plugins.jquery.com/project/history-js">history.js</a> to allow the user to quickly navigate through posts</li>
</ul>
<p></div><!-- span --></p>
<p><div class="span11"></p>
<h2>Why?</h2>
<p>A few months ago my site was hacked so  I just decided to remove the entire WordPress installation, throw up a quick one pager and try and find some motivation to get a new site up.</p>
<p>Fast forward to now and I&#8217;ve finally decided to get a site up. Nothing mind blowing, just something quick I could use to post whatever came up.</p>
<p>I decided to use Bootstrap to get a quick site up and then I can slowly start to change the styling whenever I find some time.</p>
<h3>Recent Work</h3>
<p>Right before the footer you&#8217;ll notice a recent work section. Instead of focusing on the portfolio version of the site, I&#8217;ve decided to focus more on code projects/snippets I&#8217;m working on. To be honest, most of the projects I work on are contracted out from another company so I couldn&#8217;t show it anyways. It makes it look like I&#8217;m never working on anything new.</p>
<p></div><!-- span --></p>
<p></div> <!-- row -->
]]></content:encoded>
			<wfw:commentRss>http://envexlabs.com/2011/09/the-redesign/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bootstrap for WordPress</title>
		<link>http://envexlabs.com/2011/09/bootstrap-for-wordpress/</link>
		<comments>http://envexlabs.com/2011/09/bootstrap-for-wordpress/#comments</comments>
		<pubDate>Sat, 03 Sep 2011 06:01:54 +0000</pubDate>
		<dc:creator>envex</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://envexlabs.com/?p=41</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<div class="row"></p>
<p><div class="span11"></p>
<p>A few weeks ago the Twitter team released <a href="http://twitter.github.com/bootstrap/" target="_blank">Bootstrap</a>.</p>
<p>I immediately thought that this would be a great opportunity to take what they&#8217;ve created and turn it into a WordPress theme for people to use as a starting point.</p>
<p>It&#8217;s currently a WIP, but you can view the code on Github: <a href="https://github.com/envex/Bootstrap-WordPress" target="_blank">https://github.com/envex/Bootstrap-WordPress</a></p>
<p>Simply install it like you would any other WordPress theme and your on your way.</p>
<p><div class="well"><a href="http://envexlabs.com/_dev/wordpress" class="btn small primary" target="_blank">View Demo</a><a href="https://github.com/envex/Bootstrap-WordPress" class="btn small other" target="_blank">Download from Github</a></div></p>
<p></div><!-- span --></p>
<p><div class="span5"></p>
<blockquote><p>Bootstrap is a toolkit from Twitter designed to kickstart development of webapps and sites.</p>
<p>It includes base CSS and HTML for typography, forms, buttons, tables, grids, navigation, and more.</p></blockquote>
<p></div><!-- span --></p>
<p></div> <!-- row -->
]]></content:encoded>
			<wfw:commentRss>http://envexlabs.com/2011/09/bootstrap-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Image Uploader</title>
		<link>http://envexlabs.com/2011/09/image-uploader/</link>
		<comments>http://envexlabs.com/2011/09/image-uploader/#comments</comments>
		<pubDate>Sat, 03 Sep 2011 05:41:56 +0000</pubDate>
		<dc:creator>envex</dc:creator>
				<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://envexlabs.com/?p=33</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<div class="row"></p>
<p><div class="span11"></p>
<p>I was browsing dribbble one night looking for inspiration/killing some time when I came across <a href="http://dribbble.com/shots/251571-Image-upload-idea" target="_blank">this dribbble shot</a> by <a href="http://twitter.com/#!/jessedodds" target="_blank">Jesse Dodds</a>.</p>
<p>I had just finished <a href="http://www.zurb.com/article/325/image-uploads-with-100-less-suck-guarante" target="_blank">reading a post by Zurb on creating an image uploader that didn&#8217;t suck</a> and immediatly thought I could use their method to accomplish what Jesse had planned.</p>
<p>You can <a href="http://envexlabs.com/dev/uploader" target="_blank">view a working demo</a> and if you feel like it, spread some love on twitter!</p>
<p><div class="well"><a href="http://envexlabs.com/dev/uploader" class="btn small primary" target="_blank">View Demo</a></div></p>
<p></div><!-- span --></p>
<p><div class="span5"></p>
<blockquote><p>Threw together a little sketch this afternoon, which I then whipped up in PS on the train home. Happy with where it&#8217;s headed.</p></blockquote>
<p></div><!-- span --></p>
<p></div> <!-- row -->
]]></content:encoded>
			<wfw:commentRss>http://envexlabs.com/2011/09/image-uploader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WPCoder Love</title>
		<link>http://envexlabs.com/2011/08/wpcoder-love/</link>
		<comments>http://envexlabs.com/2011/08/wpcoder-love/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 17:57:58 +0000</pubDate>
		<dc:creator>envex</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://envexlabs.com/?p=73</guid>
		<description><![CDATA[About a month ago I had a project that had a feature that allowed users to love posts. Instead of creating a one-off solution, Dan suggested that I create a plugin that we could use in future projects.]]></description>
			<content:encoded><![CDATA[<p>About a month ago I had a project that had a feature that allowed users to love posts. Instead of creating a one-off solution, Dan suggested that I create a plugin that we could use in future projects.</p>
<div class="well"><a href="https://github.com/envex/WPC-Love" class="btn small primary" target="_blank">Download from Github</a></div>
]]></content:encoded>
			<wfw:commentRss>http://envexlabs.com/2011/08/wpcoder-love/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Custom Widget</title>
		<link>http://envexlabs.com/2011/07/wordpress-custom-widget/</link>
		<comments>http://envexlabs.com/2011/07/wordpress-custom-widget/#comments</comments>
		<pubDate>Fri, 22 Jul 2011 05:10:12 +0000</pubDate>
		<dc:creator>envex</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Snippet]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://envexlabs.com/?p=25</guid>
		<description><![CDATA[Sometimes to keep a site easy to update for a client your best bet is to create a simple widget. Just like the custom post type template, I thought it would be easiest to create something that I can re-use over and over. How to Use]]></description>
			<content:encoded><![CDATA[<p>Sometimes to keep a site easy to update for a client your best bet is to create a simple widget. Just like the custom post type template, I thought it would be easiest to create something that I can re-use over and over.</p>
<h2>How to Use</h2>
<div class="row"></p>
<p><div class="span5"></p>
<h3>Step 1.</h3>
<p>Copy the <code>custom_widget.php</code> file and place it in your WordPress theme folder. Assuming WordPress is installed in the root of your server the file will be place in <code>/wp-content/themes/yourtheme/</code></p>
<h3>Step 2.</h3>
<p>Open up <code>functions.php</code> and include the following piece of code somewhere in the file. <code>include TEMPLATEPATH . '/custom_widget.php';</code></p>
<h3>Step 3.</h3>
<p>Edit the <code>custom_widget.php</code> file to suit your needs.</p>
<h3>A few things to consider</h3>
<ul>
<li>The name of your class <strong>must also</strong> be the name of your first function.</li>
<li>Don&#8217;t forget to add your variables to the <code>widget()</code>, <code>form()</code> and <code>update()</code> functions.</li>
</ul>
<p></div><!-- span --></p>
<p><div class="span11"></p>
<p><div class="github"><pre class="prettyprint linenums">&lt;?php

/*
	
	Custom Widget Template
	by Matt Vickers - http://envexlabs.com
	
	Usage
	
	Step 1: Change any values you may need to change
	
	Step 2: Include this file in your functions.php file. ex: include TEMPLATEPATH . '/custom_widget.php';
	
	Step 3: Impress your friends

*/

class Custom_Widget extends WP_Widget {

	function Custom_Widget() {
		$widget_ops = array('classname' =&gt; 'custom_widget', 'description' =&gt; 'Just a custom widget. Move along.' );
		$this-&gt;WP_Widget('custom_widget', 'Custom Widget', $widget_ops);
	}
	
	function widget($args, $instance) {

		/*
			
			Your variables from form() are automatically added to the $instance variable
			just use the array values when echoing out the HTML

		*/

		echo '&lt;h3&gt;' . $instance['title'] . '&lt;/h3&gt;';

		echo '&lt;p&gt;' . $instance['text'] . '&lt;/p&gt;';
		
	}
	
	function form($instance) {
		
		/*
			
			If you're going to add inputs to your widget, just use the code below as a template
			of what to do to add an input.
			
			1. Add to $instance
			2. Create a new variable
			3. Add the HTML

		*/
		
		$instance = wp_parse_args( (array) $instance, array( 'title' =&gt; '', 'text' =&gt; '') );
		$title = strip_tags($instance['title']);
		$entry_title = strip_tags($instance['text']); ?&gt;
		
		&lt;p&gt;&lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('title'); ?&gt;&quot;&gt;Title: &lt;input class=&quot;widefat&quot; id=&quot;&lt;?php echo $this-&gt;get_field_id('title'); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('title'); ?&gt;&quot; type=&quot;text&quot; value=&quot;&lt;?php echo attribute_escape($title); ?&gt;&quot; /&gt;&lt;/label&gt;&lt;/p&gt;
		
		&lt;p&gt;&lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('text'); ?&gt;&quot;&gt;Text: &lt;textarea class=&quot;widefat&quot; id=&quot;&lt;?php echo $this-&gt;get_field_id('text'); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('text'); ?&gt;&quot;&gt;&lt;?php echo attribute_escape($entry_title); ?&gt;&lt;/textarea&gt;&lt;/label&gt;&lt;/p&gt;
	
	&lt;?php
	
	}
	
	/*
		
		Nothing to edit below here

	*/
	
	function update($new_instance, $old_instance) {
		$instance = $old_instance;
		$instance['title'] = strip_tags($new_instance['title']);
		$instance['text'] = strip_tags($new_instance['text']);
		return $instance;
	}
	
}

register_widget('Custom_Widget');</pre><p class="view_raw"><a href="https://raw.github.com/envex/WordPress-Snippets/master/WP%20Custom%20Widget/custom_widget.php" target="_blank">View Raw</a></p></div></p>
<p></div><!-- span --></p>
<p></div> <!-- row -->
]]></content:encoded>
			<wfw:commentRss>http://envexlabs.com/2011/07/wordpress-custom-widget/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Custom Post Types</title>
		<link>http://envexlabs.com/2011/07/wordpress-custom-post-types/</link>
		<comments>http://envexlabs.com/2011/07/wordpress-custom-post-types/#comments</comments>
		<pubDate>Tue, 05 Jul 2011 02:18:43 +0000</pubDate>
		<dc:creator>envex</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Snippet]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://envexlabs.com/?p=4</guid>
		<description><![CDATA[Learn how to add a custom post type to your WordPress theme in less then 10 minutes.]]></description>
			<content:encoded><![CDATA[<p>I find that 95%* of the projects I work on now require a custom post type. After writing the same file over and over, I decided to throw up a template that I could use for any project.</p>
<p>To use the custom post template in your WordPress theme, simply follow the instructions below and you&#8217;ll be golden!</p>
<h2>How to Use</h2>
<div class="row"></p>
<p><div class="span5"></p>
<h3>Step 1.</h3>
<p>Copy the <code>custom_post_types.php</code> file and place it in your WordPress theme folder. Assuming WordPress is installed in the root of your server the file will be place in <code>/wp-content/themes/yourtheme/</code></p>
<h3>Step 2.</h3>
<p>Open up <code>functions.php</code> and include the following piece of code somewhere in the file. <code>include TEMPLATEPATH . '/custom_post_types.php';</code></p>
<h3>Step 3.</h3>
<p>Edit the <code>custom_post_types.php</code> file to suit your needs.</p>
<p></div><!-- span --></p>
<p><div class="span11"></p>
<p><div class="github"><pre class="prettyprint linenums">&lt;?php

/*

	Setup and add our custom post types

*/

function create_post_types(){
	
	/*
	
		Products
	
	*/

	register_post_type( 'my_products',
		array(
			'labels' =&gt; array(
				'name' =&gt; 'Products',
				'singular_name' =&gt; 'Product',
				'add_new' =&gt; 'Add New Product',
				'add_new_item' =&gt; 'Add New Product',
				'edit_item' =&gt; 'Edit Product',
				'new_item' =&gt; 'New Product'
			),
			'public' =&gt; true,
			'rewrite' =&gt; array(
				'slug' =&gt; 'products'
			),
			'supports' =&gt; array(
				'title',
				'editor',
				'excerpt',
				'page-attributes',
				'revisions',
				'thumbnail',
			)
		)
	);

}

function create_custom_meta(){

	/*
	
		Products
	
	*/

	add_meta_box(&quot;my_products&quot;, &quot;Product Information&quot;, &quot;my_products_meta&quot;, &quot;my_products&quot;, &quot;normal&quot;, &quot;low&quot;);
	
	function my_products_meta(){
	
		global $post;
		
		$my_model_number = get_post_meta($post-&gt;ID, 'my_model_number', true);
																
		echo '&lt;p&gt;&lt;label&gt;Model Number(s): &lt;/label&gt;&lt;input type=&quot;text&quot; name=&quot;my_model_number&quot; value=&quot;' . $my_model_number . '&quot; /&gt;&lt;br /&gt;&lt;small&gt;&lt;em&gt;For awesome people&lt;/em&gt;&lt;/small&gt;&lt;/p&gt;';	

	}

	/*
	
		Save all our info!!
	
	*/

	function save_details($post_id){
	
	     global $post;
		
		/*
		
			Save Product Info
		
		*/

		if(isset($_POST['post_type']) &amp;&amp; ($_POST['post_type'] == &quot;edisson_products&quot;)) {
	
			foreach($_POST as $k =&gt; $v){
			
				update_post_meta($post_id, $k, $v);
			
			}
		  
		}
	     
	}

	add_action(&quot;save_post&quot;, &quot;save_details&quot;);
	
}

add_action('init', 'create_post_types');
add_action('admin_menu', 'create_custom_meta');

/*

	Create the Product Types

*/

add_action( 'init', 'create_product_type_taxonomies', 0 );

function create_product_type_taxonomies() {

	$labels = array(
		'name' =&gt; _x( 'Product Types', 'products' ),
		'singular_name' =&gt; _x( 'Product Type', 'product' ),
		'search_items' =&gt;  __( 'Search Product Types' ),
		'all_items' =&gt; __( 'All Product Types' ),
		'parent_item' =&gt; __( 'Parent Genre' ),
		'parent_item_colon' =&gt; __( 'Parent Genre:' ),
		'edit_item' =&gt; __( 'Edit Product Type' ),
		'update_item' =&gt; __( 'Update Product Type' ),
		'add_new_item' =&gt; __( 'Add New Product Type' ),
		'new_item_name' =&gt; __( 'New Product Type Name' ),
	); 	

	register_taxonomy( 'product_type', array( 'my_products' ), array(
		'hierarchical' =&gt; true,
		'labels' =&gt; $labels,
		'show_ui' =&gt; true,
		'query_var' =&gt; true,
		'rewrite' =&gt; array( 'slug' =&gt; 'product' ),
	));
	
}</pre><p class="view_raw"><a href="https://raw.github.com/envex/WordPress-Snippets/master/WP%20Custom%20Post%20Types/custom_post_types.php" target="_blank">View Raw</a></p></div></p>
<p></div><!-- span --></p>
<p></div> <!-- row -->
]]></content:encoded>
			<wfw:commentRss>http://envexlabs.com/2011/07/wordpress-custom-post-types/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

