<?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>Mitch Canter is [studionashvegas] &#187; Tutorial</title>
	<atom:link href="http://www.studionashvegas.com/category/tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.studionashvegas.com</link>
	<description>Nashville, TN&#039;s Best WordPress Designer/Developer</description>
	<lastBuildDate>Tue, 07 Feb 2012 17:42:04 +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>Creating a Custom URL Shortener</title>
		<link>http://www.studionashvegas.com/tutorial/custom-url-shortener/</link>
		<comments>http://www.studionashvegas.com/tutorial/custom-url-shortener/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 17:42:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[bit.ly]]></category>
		<category><![CDATA[namecheap]]></category>
		<category><![CDATA[short url]]></category>
		<category><![CDATA[url shortener]]></category>

		<guid isPermaLink="false">http://www.studionashvegas.com/?p=2160</guid>
		<description><![CDATA[<p>Posted in <a href="http://www.studionashvegas.com/category/tutorial/" title="Tutorial">Tutorial</a></p><img width="590" height="254" src="http://cdn.studionashvegas.com/wp-content/uploads/2012/02/photo-3-590x254.jpg" class="attachment-rss-thumbnail wp-post-image" alt="photo (3)" title="photo (3)" style="margin:0; border: 10px solid #202020" />If you've come to this site by way of Twitter or Facebook, you may have noticed that the short link for all of these posts isn't your typical URL.  I recently purchased snv.me to shorten all of the links to my blog posts and site, and (after some extensive research) found a way to hook it into my site using bit.ly's pro service (now open to everyone!)]]></description>
			<content:encoded><![CDATA[<p>Posted in <a href="http://www.studionashvegas.com/category/tutorial/" title="Tutorial">Tutorial</a></p><img width="590" height="254" src="http://cdn.studionashvegas.com/wp-content/uploads/2012/02/photo-3-590x254.jpg" class="attachment-rss-thumbnail wp-post-image" alt="photo (3)" title="photo (3)" style="margin:0; border: 10px solid #202020" /><p>If you&#8217;ve come to this site by way of Twitter or Facebook, you may have noticed that the short link for all of these posts isn&#8217;t your typical URL.  I recently purchased snv.me to shorten all of the links to my blog posts and site, and (after some extensive research) found a way to hook it into my site using bit.ly&#8217;s pro service (now open to everyone!)</p>
<h3>Find a Domain</h3>
<p>You&#8217;d think this would be the easy part, but you may be mistaken.  Finding a good top-level domain (TLD) that  matches your current site may or may not be difficult, but it depends on where you&#8217;re willing to look.  <a title="Namecheap [affiliate link]" href="http://www.namecheap.com?aff=29020">Namecheap</a> has the following extensions: ws, ca, org.uk, in, cc, de, bz, tv, eu, nu, me, us, and co.  All of these two letter domains work fantastic for shortened URLs.  I chose SNV.ME because it has a nice ring, but you may find something that fits your taste.</p>
<p>If you&#8217;re looking for something more exotic, <a title="Domai.nr" href="http://domai.nr/">domai.nr</a> can look outside of the US/EU to find TLD&#8217;s that may work.  Keep in mind some of them may have additional costs and/or restrictions.</p>
<h3>Bit.ly</h3>
<p>At one point, <a href="http://bit.ly">Bit.ly</a> charged for their pro service. Now, anyone can take advantage of the power of the bit.ly URL shortener with whatever domain you want &#8211; and it&#8217;s a fairly easy set-up process.</p>
<ol>
<li>Create an account / log in to <a href="http://bit.ly">bit.ly</a></li>
<li>Click on &#8220;Settings&#8221; under the drop-down</li>
<li>Under &#8220;Custom Short Domain&#8221; click on the &#8220;Add a Custom Short Domain&#8221; link</li>
<li>The system will give you instructions on how to add bit.ly&#8217;s IP address to your domain.</li>
<li>Log in to your domain registrar and click on your DNS settings (this will differ depending on who you&#8217;ve registered with).</li>
<li>Add an A record for the IP address with your short domain.</li>
</ol>
<h3>Inside WordPress</h3>
<p>Once that&#8217;s done, you can install the <a title="Bit.ly Shortlinks" href="http://wordpress.org/extend/plugins/bitly-shortlinks/">Bit.ly Shortlinks</a> plugin.  This will allow you to manage everything automatically through WordPress.  However, there is a small bit of core-file editing to do (nothing major).  Edit your wp-config.php and paste in the following code:</p>
<pre class="qoate-code">
&lt;pre&gt;/**
 * Settings for Bit.ly Shortlinks Plugin
 * http://yoast.com/wordpress/bitly-shortlinks/
 **/
define('BITLY_USERNAME', 'BIT.LY-USERNAME');
define('BITLY_APIKEY', 'API-KEY');&lt;/pre&gt;
</pre>
<p>Your API key can be gotten by heading back to bit.ly and clicking on the settings tab &#8211; it&#8217;ll be midway down the page.</p>
<p>Now, when you create a new post, you can click the &#8220;get shortlink&#8221; button and Voila!  You can access your new shortlink and paste it wherever you wish.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.studionashvegas.com/tutorial/custom-url-shortener/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Adding Featured Images to a WordPress Post or RSS Feed</title>
		<link>http://www.studionashvegas.com/tutorial/featured-images-post-rss-feed/</link>
		<comments>http://www.studionashvegas.com/tutorial/featured-images-post-rss-feed/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 15:35:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[featured thumbnail]]></category>
		<category><![CDATA[functions.php]]></category>
		<category><![CDATA[rss feed]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.studionashvegas.com/?p=2150</guid>
		<description><![CDATA[<p>Posted in <a href="http://www.studionashvegas.com/category/tutorial/" title="Tutorial">Tutorial</a></p><img width="590" height="254" src="http://cdn.studionashvegas.com/wp-content/uploads/2012/02/binary-590x254.jpg" class="attachment-rss-thumbnail wp-post-image" alt="binary" title="binary" style="margin:0; border: 10px solid #202020" />Every post on this blog has a &#8220;featured image&#8221; &#8211; the last few have been screenshots of my blog for the]]></description>
			<content:encoded><![CDATA[<p>Posted in <a href="http://www.studionashvegas.com/category/tutorial/" title="Tutorial">Tutorial</a></p><img width="590" height="254" src="http://cdn.studionashvegas.com/wp-content/uploads/2012/02/binary-590x254.jpg" class="attachment-rss-thumbnail wp-post-image" alt="binary" title="binary" style="margin:0; border: 10px solid #202020" /><p>Every post on this blog has a &#8220;featured image&#8221; &#8211; the last few have been screenshots of my blog for the various tutorials I&#8217;ve been writing or a photo of the BlogWorld banner to talk about my speaking acceptance, but the one thing that always bothered me was that any time you used a featured image it wouldn&#8217;t show up (by default) in your theme or RSS feed.  Featured images make inserting graphics dummy-proof; the size is set automatically and all you have to do is hit upload &#8211; it takes care of all of the re-sizing for you.</p>
<h3>Setting Up Featured Images</h3>
<p>For those of you who do not use featured images in your site, it&#8217;s fairly straight-forward.  A few simple lines of code in your functions.php file and you&#8217;ll see the new option added to your writing screen:</p>
<pre class="qoate-code">

add_theme_support( 'post-thumbnails' );
add_image_size( 'blog-thumbnail', 290, 133, true ); // Permalink thumbnail size
add_image_size( 'single-thumbnail', 610, 263, true ); // Permalink thumbnail size
add_image_size( 'rss-thumbnail', 590, 254, true ); // Permalink thumbnail size
</pre>
<p>These sizes are what I use for my own blog.  There&#8217;s three custom image sizes set: one for the blogroll page (two column), one for the single article or portfolio entry, and one that&#8217;s a little smaller for my RSS-driven newsletter (more on that in a bit).</p>
<h3>Inserting a Featured Image Into a Post</h3>
<p>The concept remains the same no matter what page template you&#8217;re working on, but my single.php page contains this code:</p>
<pre class="qoate-code">

&lt;span class="single-thumbnail"&gt;
&lt;?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'single-thumbnail'); } else { ?&gt;
&lt;img src="&lt;?php bloginfo('template_directory'); ?&gt;/images/large-default.jpg" /&gt;
&lt;?php } ?&gt;
&lt;/span&gt;
</pre>
<p>Now, what I&#8217;ve done here is fairly complex looking, but it&#8217;s actually simple to understand.  The IF statement checks to see if a featured thumbnail has been set.  If so, it displays the predetermined size (in this case, single-thumbnail).  If not, it falls back to a default image and displays it instead.  The span tag allows even the default image to be styled as I want it to (on this blog, it&#8217;s a 10px solid stroke).</p>
<p>Drop this in anywhere between your IF_POSTS and ENDIF tags, and you should be good to go.</p>
<h3>Inserting a Featured Image Into an RSS Feed</h3>
<p>Unfortunately, unlike the template, there&#8217;s not a file you can edit to add things to your RSS feed.  You have to do it via your functions.php file since editing core files is against best practices.  However, it&#8217;s fairly straightforward:</p>
<pre class="qoate-code">

function featuredtoRSS($content) {
global $post;
if ( has_post_thumbnail( $post-&gt;ID ) ){
$content = '' . get_the_post_thumbnail( $post-&gt;ID, 'rss-thumbnail', array( 'style' =&gt; 'margin:0; border: 10px solid #202020' ) ) . '' . $content;
}
return $content;
}

add_filter('the_excerpt_rss', 'featuredtoRSS');
add_filter('the_content_feed', 'featuredtoRSS');
</pre>
<p>This creates a new function &#8216;featuredtoRSS&#8217; and adds it to the $content variable defined in $post by WordPress.  In other words, it appends your featured thumbnail onto already created content, appending it to the end of &#8220;the_excerpt_rss&#8221; and &#8220;the_content_feed&#8221; rss tags. Now, if you refresh your feed, you&#8217;ll see your nice thumbnails showing up for all to see (and it keeps you from having to actually insert photos into your site).</p>
<h3>&#8220;But Mitch, I Have Lots of Images Already &#8211; Do I Have To Reload Them All To Get The New Sizes?&#8221;</h3>
<p>No!  That&#8217;s the joy of plugins.  Download and install Viper007Bond&#8217;s &#8220;<a title="Regenerate Thumbnails" href="http://wordpress.org/extend/plugins/regenerate-thumbnails/" target="_blank">Regenerate Thumbnails</a>&#8221; plugin and run the script.  It&#8217;ll take a few minutes if you have a lot of photos, but it will create photos for every size imaginable (or at least defined in your functions.php file)</p>
<p><a title="Regenerate Thumbnails" href="http://wordpress.org/extend/plugins/regenerate-thumbnails/" target="_blank">Learn More About Regenerate Thumbnails</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.studionashvegas.com/tutorial/featured-images-post-rss-feed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building a Portfolio With Custom Post Types / Taxonomies: Enhancing The Archive</title>
		<link>http://www.studionashvegas.com/tutorial/custom-post-type-portfolio-archive-enhancement/</link>
		<comments>http://www.studionashvegas.com/tutorial/custom-post-type-portfolio-archive-enhancement/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 16:37:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[custom post type]]></category>
		<category><![CDATA[custom taxonomy]]></category>
		<category><![CDATA[portfolio in WordPress]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.studionashvegas.com/?p=2142</guid>
		<description><![CDATA[<p>Posted in <a href="http://www.studionashvegas.com/category/tutorial/" title="Tutorial">Tutorial</a></p><img width="338" height="254" src="http://cdn.studionashvegas.com/wp-content/uploads/2012/02/photo-2.jpg" class="attachment-rss-thumbnail wp-post-image" alt="photo (2)" title="photo (2)" style="margin:0; border: 10px solid #202020" />Yesterday we finished our portfolio, built with a custom post type, three taxonomies, and some custom field information]]></description>
			<content:encoded><![CDATA[<p>Posted in <a href="http://www.studionashvegas.com/category/tutorial/" title="Tutorial">Tutorial</a></p><img width="338" height="254" src="http://cdn.studionashvegas.com/wp-content/uploads/2012/02/photo-2.jpg" class="attachment-rss-thumbnail wp-post-image" alt="photo (2)" title="photo (2)" style="margin:0; border: 10px solid #202020" /><p>Yesterday we finished our portfolio, built with a custom post type, three taxonomies, and some custom field information that we can use to display lots of data about our pieces.  Today is a bonus; we&#8217;ve got all these really cool taxonomies, but no way to really browse the portfolio based on a specific term.</p>
<ul>
<li><span style="color: #999999;">Create the Post Type (done yesterday)</span></li>
<li><span style="color: #999999;">Create The Taxonomies (Color Scheme [tag based], Work Done, WordPress Functionality Used) (done yesterday)</span></li>
<li><span style="color: #999999;">Create Archive / Single pages for post type</span></li>
<li><span style="color: #999999;">Create Meta Box</span></li>
<li><span style="color: #999999;">Assign Meta Box Data to Single Page</span></li>
<li>Assign Taxonomy Data to Archive Page</li>
<li>Add Taxonomy Title to Fallback Archives</li>
</ul>
<p>Once this is done, your portfolio will be browsable, functional, and look pretty awesome too!</p>
<h3>Adding Taxonomy Data to the Archive Pages</h3>
<p>When you visit a single portfolio entry, you&#8217;ll remember now we have all of that information on the right side.  We want to do something similar for the main archive page, and all subsequent taxonomy archive pages, but showing <strong>all</strong> of the options to choose from.</p>
<p>There&#8217;s three taxonomies, but what fun is it to just show a bulleted list for every taxonomy?  Let&#8217;s turn one of them into a drop-down menu.</p>
<pre class="qoate-code">

function get_terms_dropdown($taxonomies, $args){
$myterms = get_terms($taxonomies, $args);
$output ="&lt;select name='wordpress_functionality'&gt;";
$output .="&lt;option value='#'&gt; &lt;/option&gt;";
foreach($myterms as $term){
$root_url = get_bloginfo('url');
$term_taxonomy=$term-&gt;taxonomy;
$term_slug=$term-&gt;slug;
$term_name =$term-&gt;name;
$link = $term_slug;
$output .="&lt;option value='".$link."'&gt;".$term_name."&lt;/option&gt;";
}
$output .="&lt;/select&gt;";
return $output;
}
</pre>
<p>Make sure to change the value to match the one you want to showcase.</p>
<p>Next, we&#8217;ll head over to sidebar.php.  Drop this into your sidebar:</p>
<pre class="qoate-code">

&lt;!--portfolio archive widgets--&gt;
&lt;?php if ( 'portfolio' == get_post_type() &amp;&amp; is_archive() ) { ?&gt;
&lt;li class="widget"&gt;
&lt;h4 class="widgettitle"&gt;Browse Portfolio&lt;/h4&gt;
&lt;h5&gt;Work Done&lt;/h5&gt;
&lt;ul&gt;&lt;?php wp_list_categories('taxonomy=work_done&amp;title_li='); ?&gt;&lt;/ul&gt;
&lt;h5&gt;WordPress Functionality&lt;/h5&gt;
&lt;form action="&lt;?php bloginfo('url'); ?&gt;" method="get"&gt;
&lt;?php
$taxonomies = array('wordpress_functionality');
$args = array('orderby'=&gt;'name','hide_empty'=&gt;true);
$select = get_terms_dropdown($taxonomies, $args);

$select = preg_replace("#&lt;select([^&gt;]*)&gt;#", "&lt;select$1 onchange='return this.form.submit()'&gt;", $select);
echo $select;
?&gt;
&lt;noscript&gt;&lt;div&gt;&lt;input type="submit" value="Go" /&gt;&lt;/div&gt;&lt;/noscript&gt;
&lt;/form&gt;
&lt;h5&gt;By Color:&lt;/h5&gt;
&lt;ul&gt;&lt;?php wp_list_categories('taxonomy=color_scheme&amp;title_li='); ?&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;?php } ?&gt;
</pre>
<p>There are three sections: the Work Done section, the WordPress Functionality section (our drop-down), and Color Scheme.  I&#8217;m using wp_list_categories to pull a bulleted list for each of the taxonomies, and the form in the middle is the drop down for the functionality section.  By wrapping it in a conditional tag we ensure it only shows up 1) on the portfolio pages and 2) only when displaying an archive.</p>
<p>However, we still have one problem: None of the archive templates (typically) make arrangements for custom taxonomies.  Let&#8217;s fix that.</p>
<h3>Add Taxonomy Title to Fallback Archives</h3>
<p>Edit your archive.php and add this in just before the &lt;?php while (have_posts()) : the_post(); ?&gt;  line:</p>
<pre class="qoate-code">

&lt;?php if( is_tax() ) {
global $wp_query;
$term = $wp_query-&gt;get_queried_object();
$title = $term-&gt;name; ?&gt;
&lt;h2 class="pagetitle"&gt;&lt;?php echo $title ?&gt;&lt;/h2&gt;
&lt;?php } ?&gt;
</pre>
<p>This will display your term&#8217;s name as the page title.</p>
<h3>Wrapping It Up</h3>
<p>And that&#8217;s it!  We&#8217;ve created our portfolio, added templates to customize it, set up the taxonomies to sort our data, and provided a means to display that data on both the single and archive portfolio pages.  Obviously these can be tweaked to your specifications, but I&#8217;ve found a lot of utility in having the data searchable and browsable in many different ways.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.studionashvegas.com/tutorial/custom-post-type-portfolio-archive-enhancement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building a Portfolio With Custom Post Types / Taxonomies: Files &amp; Meta</title>
		<link>http://www.studionashvegas.com/tutorial/custom-post-type-portfolio-files-and-meta/</link>
		<comments>http://www.studionashvegas.com/tutorial/custom-post-type-portfolio-files-and-meta/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 15:11:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[archive]]></category>
		<category><![CDATA[custom post type]]></category>
		<category><![CDATA[custom taxonomy]]></category>
		<category><![CDATA[more fields]]></category>
		<category><![CDATA[portfolio in WordPress]]></category>

		<guid isPermaLink="false">http://www.studionashvegas.com/?p=2135</guid>
		<description><![CDATA[<p>Posted in <a href="http://www.studionashvegas.com/category/tutorial/" title="Tutorial">Tutorial</a></p><img width="338" height="254" src="http://cdn.studionashvegas.com/wp-content/uploads/2012/02/photo-1.jpg" class="attachment-rss-thumbnail wp-post-image" alt="photo-(1)" title="photo-(1)" style="margin:0; border: 10px solid #202020" />Yesterday we took a look at the beginning parts of building a portfolio using WordPress.  It basically boiled down to a]]></description>
			<content:encoded><![CDATA[<p>Posted in <a href="http://www.studionashvegas.com/category/tutorial/" title="Tutorial">Tutorial</a></p><img width="338" height="254" src="http://cdn.studionashvegas.com/wp-content/uploads/2012/02/photo-1.jpg" class="attachment-rss-thumbnail wp-post-image" alt="photo-(1)" title="photo-(1)" style="margin:0; border: 10px solid #202020" /><p>Yesterday we took a look at the beginning parts of <a title="Building a Portfolio using WordPress" href="http://www.studionashvegas.com/tutorial/custom-post-type-portfolio-overview/" target="_blank">building a portfolio using WordPress</a>.  It basically boiled down to a few parts:</p>
<ul>
<li><span style="color: #999999;">Create the Post Type (done yesterday)</span></li>
<li><span style="color: #999999;">Create The Taxonomies (Color Scheme [tag based], Work Done, WordPress Functionality Used) (done yesterday)</span></li>
<li>Create Archive / Single pages for post type</li>
<li>Create Meta Box</li>
<li>Assign Meta Box Data to Single Page</li>
<li>Assign Taxonomy Data to Archive Page</li>
<li>Add Taxonomy Title to Fallback Archives</li>
</ul>
<p>The last post talked about creating the post type and taxonomy.  Today we&#8217;ll talk about how to create files specific to that post type, and how to store the extra &#8220;meta&#8221; information into a post so you can pull it out later.</p>
<h3>Creating the Archive / Single Templates</h3>
<p>With WordPress&#8217; template system, there&#8217;s a lot of flexibility in how data is displayed.  Templates use a &#8220;fallback&#8221; system so that if one template can&#8217;t be found, it&#8217;ll simply use another, more generic template.</p>
<p>For example, your archive posts (tags + categories) use this order:</p>
<pre class="qoate-code">category-SLUG.php &gt; category-ID.php &gt; category.php &gt; archive.php &gt; index.php</pre>
<p>If category-SLUG.php isn&#8217;t available, the more generic files get used (down to category.php, then archive.php).  Index.php is the &#8220;catch-all&#8221;. Custom post types are no exception.  By using &#8220;archive-POSTTYPE.php&#8221; you can override the default archive.php style.</p>
<p>The single-POSTTYPE.php file is the same way.  Whereas normally single.php would be the default view for a file, single-POSTTYPE.php can allow you to have a customized single article view for your post type.</p>
<p>So, why would I want to create these files?  Two reasons:</p>
<ol>
<li>On my archive page, I wanted to get rid of the excerpt text and shrink down the boxes to fit the new style (since I have to have a hard-height parameter set to allow the meta information to look like it does.</li>
<li>On my single page, I wanted to <strong>remove </strong>the meta information and add buttons for ShareThis and Pinterest (since that section is very image heavy).</li>
</ol>
<p>I could make any changes I wanted to, but once I&#8217;m done I have two files (archive-portfolio.php and single-portfolio.php) that allow me full customization on those sections.</p>
<h3>Creating a Meta Box</h3>
<p>A Custom Meta Box is a content piece that goes in the write screen of your posts or page section.  It allows you to fill in the blanks to store extra meta information and call that information back out later to display in a different way.</p>
<p>For my single portfolio articles, I wanted to use both my taxonomy data and some specialized data to showcase each site:</p>
<ul>
<li>Client&#8217;s Name</li>
<li>Website Name</li>
<li>Website URL</li>
<li>Testimonial Section (if I had one)</li>
</ul>
<p>For this, I decided to use the &#8220;<a title="More Fields" href="http://wordpress.org/extend/plugins/more-fields/" target="_blank">More Fields</a>&#8221; plugin.  It uses a GUI interface to create a meta box that stores custom field data.  I can then use echo statements to pull the data out later.</p>
<h3>The Process: Meta Boxes</h3>
<ol>
<li>Download and install &#8220;More Fields&#8221;</li>
<li>Head to the &#8220;More Fields&#8221; settings menu</li>
<li>Create a Meta Box</li>
<li>Edit your newly created box</li>
<li>Add Input Fields<br />
(once you do this, you&#8217;ll see two values and an option that must be filled in: Field Name, Custom Field Name, and  Type.  Make sure you remember specifically the custom field name; you&#8217;ll need it in a bit)</li>
<li>Save &amp; Repeat for any extra boxes you want to create</li>
</ol>
<h3>Adding the Meta Information to the Portfolio Page</h3>
<p>I wanted my information to stand out, so instead of adding it to the portfolio page directly, I decided to add it to the sidebar instead (at the top) to attract more attention.  This posed a problem, however, as (unlike the portfolio page) the sidebar was visible on every page.</p>
<p>Here&#8217;s the full code, with my fix for this, and we can walk through it:</p>
<pre class="qoate-code">

&lt;?php if ( 'portfolio' == get_post_type() &amp;&amp; !is_archive() ) { ?&gt;
&lt;li class="widget portfolioInfoWidget"&gt;
&lt;h4 class="widgettitle"&gt;Portfolio Information&lt;/h4&gt;
&lt;p&gt;Client Name: &lt;span class="blue"&gt;&lt;?php echo get_post_meta($post-&gt;ID, 'snv-client', true) ?&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Website: &lt;a target="_blank" class="blue" href="&lt;?php echo get_post_meta($post-&gt;ID, 'snv-weblink', true) ?&gt;"&gt;&lt;?php echo get_post_meta($post-&gt;ID, 'snv-website', true) ?&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Work Done: &lt;?php echo get_the_term_list($post-&gt;ID, 'work_done', '', ', ', ''); ?&gt;&lt;/p&gt;
&lt;p&gt;Project Status: &lt;span class="blue"&gt;&lt;?php echo get_post_meta($post-&gt;ID, 'snv-status', true) ?&gt;&lt;/span&gt;&lt;/p&gt;
&lt;?php if ( get_post_meta($post-&gt;ID, 'snv-testimonial', true) ) : ?&gt;
&lt;p&gt;From The Client:&lt;br /&gt;
&lt;em&gt;&lt;?php echo get_post_meta($post-&gt;ID, 'snv-testimonial', true) ?&gt;&lt;/em&gt;&lt;/p&gt;
&lt;?php endif; ?&gt;

&lt;/li&gt;

&lt;li class="widget portfolioInfoWidget"&gt;
&lt;h4 class="widgettitle"&gt;Color Palette&lt;/h4&gt;
&lt;?php echo get_the_term_list($post-&gt;ID, 'color_scheme', '', ', ', ''); ?&gt;
&lt;/li&gt;

&lt;li class="widget portfolioInfoWidget"&gt;
&lt;h4 class="widgettitle"&gt;WordPress Functionality&lt;/h4&gt;
&lt;?php echo get_the_term_list($post-&gt;ID, 'wordpress_functionality', '', '&lt;br /&gt;', ''); ?&gt;
&lt;/li&gt;

&lt;?php } ?&gt;
</pre>
<p>Here are the important parts.  Line 1 is a conditional statement that tells WordPress to only display this piece of code if two conditions are met: 1) it&#8217;s the portfolio post type and 2) if it&#8217;s NOT the archive page [hence the bang symbol].  Anything with &lt;?php echo&#8230; ?&gt; is what we use to display the custom meta information we stored earlier.  Simply replace the variable (&lt;?php echo get_post_meta($post-&gt;ID, &#8216;VARIABLE&#8217;, true) ?&gt;) with your custom field key from earlier.  Line 6 shows a comma separated list of the custom taxonomy terms.</p>
<p>It&#8217;s also worth noting line 8.  It uses another conditional tag to check to see if a value has any information in it (snv-testimonial) and only displays the information if it isn&#8217;t null.</p>
<h3>Where We Stand</h3>
<p>So far we&#8217;ve created our post type and taxonomies, created custom archive + single pages for them, added our meta information, and displayed that information on the sidebar.  We are <strong>technically</strong> finished, as once you get your information in you could start viewing the portfolio page and seeing your newly created templates at work.  However, our taxonomy page is a little&#8230; lacking.  It has no title and no way to sort through all those nice taxonomy pages we created.  And we don&#8217;t just want endless lists of information; we want to store the longer ones in a drop-down for ease of viewing.  Plus, our taxonomy page doesn&#8217;t even have a title.</p>
<p>That&#8217;s where we&#8217;ll pick it up next time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.studionashvegas.com/tutorial/custom-post-type-portfolio-files-and-meta/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building a Portfolio With Custom Post Types / Taxonomies: Overview</title>
		<link>http://www.studionashvegas.com/tutorial/custom-post-type-portfolio-overview/</link>
		<comments>http://www.studionashvegas.com/tutorial/custom-post-type-portfolio-overview/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 16:41:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.studionashvegas.com/?p=2111</guid>
		<description><![CDATA[<p>Posted in <a href="http://www.studionashvegas.com/category/tutorial/" title="Tutorial">Tutorial</a></p><img width="338" height="254" src="http://cdn.studionashvegas.com/wp-content/uploads/2012/02/photo.jpg" class="attachment-rss-thumbnail wp-post-image" alt="photo" title="photo" style="margin:0; border: 10px solid #202020" />When I created the new version of this site, one of the main areas I wanted to focus on was the portfolio.  I&#8217;d had a]]></description>
			<content:encoded><![CDATA[<p>Posted in <a href="http://www.studionashvegas.com/category/tutorial/" title="Tutorial">Tutorial</a></p><img width="338" height="254" src="http://cdn.studionashvegas.com/wp-content/uploads/2012/02/photo.jpg" class="attachment-rss-thumbnail wp-post-image" alt="photo" title="photo" style="margin:0; border: 10px solid #202020" /><p>When I created the new version of this site, one of the main areas I wanted to focus on was the portfolio.  I&#8217;d had a really&#8230; underwhelming one that was powered by ShrinkTheWeb who (recently) decided to charge for the services I was needing.  I took that as a good sign that I should get my new site up quickly, but thought about the best way to really go about structuring it.  I immediately knew that a Custom Post Type was the best way to build a portfolio in WordPress, but I didn&#8217;t want to stop there; I wanted a portfolio that was just as functional as it was nice looking.</p>
<p>Now that it&#8217;s finally complete, I wanted to share with you guys the process I used to create a portfolio in WordPress; in hopes you could take it and (like all good developers) make it your own.</p>
<p>The process boils down into X points:</p>
<ul>
<li>Create the Post Type</li>
<li>Create The Taxonomies (Color Scheme [tag based], Work Done, WordPress Functionality Used)</li>
<li>Create Archive / Single pages for post type</li>
<li>Create Meta Box</li>
<li>Assign Meta Box Data to Single Page</li>
<li>Assign Taxonomy Data to Archive Page</li>
<li>Add Taxonomy Title to Fallback Archives</li>
</ul>
<p>I&#8217;ll go over all of them in detail, but I thought it was worth an overview to show you the steps I took to get from point A to point B.</p>
<h3>Creating The Post Type</h3>
<p>Nothing really special here; if you&#8217;ve ever created a post type before this is just your run-of-the-mill custom post.  If you  haven&#8217;t, what this does is create a separate type of content (think pages or posts) that you can add data to, then call back out when you need it.  Luckily WordPress has done a lot of the heavy lifting, so a few lines of code will get us everything we need to build our WordPress portfolio.</p>
<p><em>(note: I&#8217;m using Themergency&#8217;s Custom Post Type Generator &amp; Taxonomy Generator for the  below code; make sure that if you use a generator you take the time to learn the why, and not just copy/paste it.  I use it to save time, not to do my job for me after all.)</em></p>
<pre class="qoate-code">

add_action( 'init', 'register_cpt_portfolio' );

function register_cpt_portfolio() {

$labels = array(
'name' =&gt; _x( 'Portfolio', 'portfolio' ),
'singular_name' =&gt; _x( 'Portfolio', 'portfolio' ),
'add_new' =&gt; _x( 'Add New', 'portfolio' ),
'add_new_item' =&gt; _x( 'Add New Entry', 'portfolio' ),
'edit_item' =&gt; _x( 'Edit Portfolio Entry', 'portfolio' ),
'new_item' =&gt; _x( 'New Portfolio Entry', 'portfolio' ),
'view_item' =&gt; _x( 'View Portfolio', 'portfolio' ),
'search_items' =&gt; _x( 'Search Portfolio Entries', 'portfolio' ),
'not_found' =&gt; _x( 'No entries found', 'portfolio' ),
'not_found_in_trash' =&gt; _x( 'No entries found in Trash', 'portfolio' ),
'parent_item_colon' =&gt; _x( 'Parent Portfolio:', 'portfolio' ),
'menu_name' =&gt; _x( 'Portfolio', 'portfolio' ),
);

$args = array(
'labels' =&gt; $labels,
'hierarchical' =&gt; false,
'description' =&gt; 'Portfolio post type generated for studionashvegas.',
'supports' =&gt; array( 'title', 'editor', 'author', 'thumbnail', 'custom-fields' ),

'public' =&gt; true,
'show_ui' =&gt; true,
'show_in_menu' =&gt; true,
'menu_position' =&gt; 5,

'show_in_nav_menus' =&gt; true,
'publicly_queryable' =&gt; true,
'exclude_from_search' =&gt; false,
'has_archive' =&gt; true,
'query_var' =&gt; true,
'can_export' =&gt; true,
'rewrite' =&gt; true,
'capability_type' =&gt; 'post'
);

register_post_type( 'portfolio', $args );
}
</pre>
<p>I&#8217;ve set it up as a page structure since there will be no &#8220;child pages&#8221;.  Otherwise, it&#8217;s fairly standard (able to be queried, exported, has rewrite rules, etc)</p>
<h3>Setting up the Taxonomies</h3>
<p>Once that&#8217;s done, we can focus on the taxonomies.  I&#8217;ve chosen three ways I want to sort my portfolio data: by the Work I&#8217;ve Done, specific WordPress functionality I&#8217;ve used, and the colors used in the design.  The colors will be defined as tags; the work and functionality defined as a &#8220;category&#8221; structure.</p>
<pre class="qoate-code">

add_action( 'init', 'register_taxonomy_work_done' );

function register_taxonomy_work_done() {

$labels = array(
'name' =&gt; _x( 'Work Done', 'work done' ),
'singular_name' =&gt; _x( 'Work Done', 'work done' ),
'search_items' =&gt; _x( 'Search Work Done', 'work done' ),
'popular_items' =&gt; _x( 'Popular Work Done', 'work done' ),
'all_items' =&gt; _x( 'All Work Done', 'work done' ),
'parent_item' =&gt; _x( 'Parent Work Done', 'work done' ),
'parent_item_colon' =&gt; _x( 'Parent Work Done:', 'work done' ),
'edit_item' =&gt; _x( 'Edit Work Done', 'work done' ),
'update_item' =&gt; _x( 'Update Work Done', 'work done' ),
'add_new_item' =&gt; _x( 'Add New Work Done', 'work done' ),
'new_item_name' =&gt; _x( 'New Work Done Name', 'work done' ),
'separate_items_with_commas' =&gt; _x( 'Separate work done with commas', 'work done' ),
'add_or_remove_items' =&gt; _x( 'Add or remove work done', 'work done' ),
'choose_from_most_used' =&gt; _x( 'Choose from the most used work done', 'work done' ),
'menu_name' =&gt; _x( 'Work Done', 'work done' ),
);

$args = array(
'labels' =&gt; $labels,
'public' =&gt; true,
'show_in_nav_menus' =&gt; true,
'show_ui' =&gt; true,
'show_tagcloud' =&gt; true,
'hierarchical' =&gt; true,

'rewrite' =&gt; true,
'query_var' =&gt; true
);

register_taxonomy( 'work_done', array('portfolio'), $args );
}

add_action( 'init', 'register_taxonomy_color_scheme' );

function register_taxonomy_color_scheme() {

$labels = array(
'name' =&gt; _x( 'Color Schemes', 'color scheme' ),
'singular_name' =&gt; _x( 'Color Scheme', 'color scheme' ),
'search_items' =&gt; _x( 'Search Color Schemes', 'color scheme' ),
'popular_items' =&gt; _x( 'Popular Color Schemes', 'color scheme' ),
'all_items' =&gt; _x( 'All Color Schemes', 'color scheme' ),
'parent_item' =&gt; _x( 'Parent Color Scheme', 'color scheme' ),
'parent_item_colon' =&gt; _x( 'Parent Color Scheme:', 'color scheme' ),
'edit_item' =&gt; _x( 'Edit Color Scheme', 'color scheme' ),
'update_item' =&gt; _x( 'Update Color Scheme', 'color scheme' ),
'add_new_item' =&gt; _x( 'Add New Color Scheme', 'color scheme' ),
'new_item_name' =&gt; _x( 'New Color Scheme Name', 'color scheme' ),
'separate_items_with_commas' =&gt; _x( 'Separate color schemes with commas', 'color scheme' ),
'add_or_remove_items' =&gt; _x( 'Add or remove color schemes', 'color scheme' ),
'choose_from_most_used' =&gt; _x( 'Choose from the most used color schemes', 'color scheme' ),
'menu_name' =&gt; _x( 'Color Schemes', 'color scheme' ),
);

$args = array(
'labels' =&gt; $labels,
'public' =&gt; true,
'show_in_nav_menus' =&gt; true,
'show_ui' =&gt; true,
'show_tagcloud' =&gt; true,
'hierarchical' =&gt; false,

'rewrite' =&gt; true,
'query_var' =&gt; true
);

register_taxonomy( 'color_scheme', array('portfolio'), $args );
}

add_action( 'init', 'register_taxonomy_wordpress_functionality' );

function register_taxonomy_wordpress_functionality() {

$labels = array(
'name' =&gt; _x( 'WordPress Functionality', 'wordpress functionality' ),
'singular_name' =&gt; _x( 'WordPress Functionality', 'wordpress functionality' ),
'search_items' =&gt; _x( 'Search WordPress Functionality', 'wordpress functionality' ),
'popular_items' =&gt; _x( 'Popular WordPress Functionality', 'wordpress functionality' ),
'all_items' =&gt; _x( 'All WordPress Functionality', 'wordpress functionality' ),
'parent_item' =&gt; _x( 'Parent WordPress Functionality', 'wordpress functionality' ),
'parent_item_colon' =&gt; _x( 'Parent WordPress Functionality:', 'wordpress functionality' ),
'edit_item' =&gt; _x( 'Edit WordPress Functionality', 'wordpress functionality' ),
'update_item' =&gt; _x( 'Update WordPress Functionality', 'wordpress functionality' ),
'add_new_item' =&gt; _x( 'Add New WordPress Functionality', 'wordpress functionality' ),
'new_item_name' =&gt; _x( 'New WordPress Functionality Name', 'wordpress functionality' ),
'separate_items_with_commas' =&gt; _x( 'Separate wordpress functionality with commas', 'wordpress functionality' ),
'add_or_remove_items' =&gt; _x( 'Add or remove wordpress functionality', 'wordpress functionality' ),
'choose_from_most_used' =&gt; _x( 'Choose from the most used wordpress functionality', 'wordpress functionality' ),
'menu_name' =&gt; _x( 'WordPress Functionality', 'wordpress functionality' ),
);

$args = array(
'labels' =&gt; $labels,
'public' =&gt; true,
'show_in_nav_menus' =&gt; true,
'show_ui' =&gt; true,
'show_tagcloud' =&gt; true,
'hierarchical' =&gt; true,

'rewrite' =&gt; true,
'query_var' =&gt; true
);

register_taxonomy( 'wordpress_functionality', array('portfolio'), $args );
}
</pre>
<p><a href="http://cdn.studionashvegas.com/wp-content/uploads/2012/02/portfolio-flyout.jpg" rel="shadowbox[sbpost-2111];player=img;"><img class="alignleft size-thumbnail wp-image-2122" title="portfolio-flyout" src="http://cdn.studionashvegas.com/wp-content/uploads/2012/02/portfolio-flyout-150x150.jpg" alt="" width="150" height="150" /></a>Once that&#8217;s done, you should see your new entry below &#8220;posts&#8221; on the left menu, with your three taxonomies underneath.  The first step is complete.  I&#8217;ll go more into detail on the specific templates used, as well as sidebar content that changes whether you&#8217;re in the portfolio or not, and even between single portfolio entries and their archive pages.  Our WordPress portfolio is well on its way!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.studionashvegas.com/tutorial/custom-post-type-portfolio-overview/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Top 5 Things to Do After Installing Your New WordPress Blog</title>
		<link>http://www.studionashvegas.com/tutorial/top-5-things-to-do-after-installing-wordpress/</link>
		<comments>http://www.studionashvegas.com/tutorial/top-5-things-to-do-after-installing-wordpress/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 15:21:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[settings]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.studionashvegas.com/?p=1627</guid>
		<description><![CDATA[<p>Posted in <a href="http://www.studionashvegas.com/category/tutorial/" title="Tutorial">Tutorial</a></p>So you&#8217;ve gotten your new website up and ready to go &#8211; and you&#8217;re chomping at the bit to add some delicious]]></description>
			<content:encoded><![CDATA[<p>Posted in <a href="http://www.studionashvegas.com/category/tutorial/" title="Tutorial">Tutorial</a></p><p>So you&#8217;ve gotten your new website up and ready to go &#8211; and you&#8217;re chomping at the bit to add some delicious content.  But don&#8217;t jump the gun just yet &#8211; there&#8217;s a few things you need to do before you start releasing your new site to the masses.</p>
<h2>1. Change your Permalinks</h2>
<p>Right now when people try to view your blog all they see is your URL and a string of numbers &#8211; hardly appealing to your readers, or to the search engines.  It&#8217;s dead simple to change them.  Just go into your Settings &gt; Permalinks page and either select one of the options or enter your own.  I prefer &#8220;category/postname&#8221; but everyone has their own preferred method.</p>
<p><img class="alignnone size-full wp-image-1632" title="permalinks1" src="http://cdn.studionashvegas.com/wp-content/uploads/2011/09/permalinks11.png" alt="" width="143" height="321" /><img class="size-full wp-image-1629 alignnone" title="permalinks2" src="http://cdn.studionashvegas.com/wp-content/uploads/2011/09/permalinks2.png" alt="" width="620" height="321" /></p>
<h2>2. Change your Admin Password</h2>
<p>You DID use a different admin account other than &#8220;admin&#8221; right?  If you use admin as your username, you are giving hackers 50% of the information they need to log into your site.  Do yourself a favor: use a different username and pick a great password.  And change it often.  Already created that &#8220;admin&#8221; account?  Simply create a new one (NOT named admin), give it administrator privileges, and delete your admin account.  You can migrate your posts over to the new user in one go.</p>
<p><img class="alignnone size-full wp-image-1633" title="username2" src="http://cdn.studionashvegas.com/wp-content/uploads/2011/09/username2.png" alt="" width="445" height="240" /></p>
<h2>3. Rename your Default Category</h2>
<p>Uncategorized is not a category &#8211; it&#8217;s a sign that you don&#8217;t care enough to sort your content.  Do yourself a favor and rename that to whatever you want (news, personal, etc.).  Make sure it&#8217;s relevant to the topic at hand.  If you&#8217;ve already posted into the category, no problem!  All the changes are retroactive, so anything new will be added to the right category automatically, and any old posts will be transferred over.  Simply go to Posts &gt; Categories and edit the category you choose.  Make sure to edit both the category name and the slug (the url base for that category).</p>
<p>As a bonus tip, if you want  a cool way to showcase some content on your category archives, you can add <em>&lt;?php echo category_description(); ?&gt; </em>to your archive pages &#8211; then you can add descriptions to further focus your SEO and give your readers an intro to each category.</p>
<p><img class="alignnone size-full wp-image-1634" title="slug1" src="http://cdn.studionashvegas.com/wp-content/uploads/2011/09/slug1.png" alt="" width="490" height="238" /></p>
<h2>4. Change your Title / Description</h2>
<p>I  can&#8217;t tell you how many RSS feeds I visit that have &#8220;Just Another WordPress Blog&#8221; as their description &#8211; or even worse, nothing!  Make sure it&#8217;s relevant to your topic.  You can change it under Settings &gt; General.</p>
<p><img class="alignnone size-full wp-image-1635" title="name1" src="http://cdn.studionashvegas.com/wp-content/uploads/2011/09/name1.png" alt="" width="547" height="130" /></p>
<h2>5. Add In Some Fun Plugins</h2>
<ul>
<li><a title="Livefyre" href="http://wordpress.org/extend/plugins/livefyre-comments/" target="_blank">Livefyre</a> &#8211; Social Commenting System</li>
<li><a title="All In One SEO" href="http://wordpress.org/extend/plugins/all-in-one-seo-pack/" target="_blank">All In One SEO</a> / <a title="WordPress SEO by Yoast" href="http://wordpress.org/extend/plugins/wordpress-seo/" target="_blank">Yoast SEO</a> &#8211; for&#8230; uh&#8230; SEO</li>
<li><a title="Google Analyticator" href="http://wordpress.org/extend/plugins/google-analyticator/" target="_blank">Google Analyticator</a> &#8211; Google Analytics</li>
<li><a title="Woopra" href="http://wordpress.org/extend/plugins/woopra/" target="_blank">Woopra</a> &#8211; Woopra Analytics</li>
<li><a title="Digg Digg" href="http://wordpress.org/extend/plugins/digg-digg/" target="_blank">Digg Digg</a> / SexyBookmarks &#8211; social sharing</li>
<li><a title="Google XML Sitemaps" href="http://wordpress.org/extend/plugins/google-sitemap-generator/" target="_blank">Google XML Sitemaps</a> &#8211; creates a crawlable sitemap for Google</li>
<li><a title="Shadowbox JS" href="http://wordpress.org/extend/plugins/shadowbox-js/" target="_blank">Shadowbox JS</a> &#8211; allows javascript click-to-view-larger-image capabilities</li>
<li><a title="W3 Total Cache" href="http://wordpress.org/extend/plugins/w3-total-cache/" target="_blank">W3 Total Cache</a> &#8211; caches site and allows for faster load times</li>
<li><a title="WPTouch" href="http://wordpress.org/extend/plugins/wptouch/" target="_blank">WP Touch</a> &#8211; mobile optimized site</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.studionashvegas.com/tutorial/top-5-things-to-do-after-installing-wordpress/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Feed Me! Bring an RSS Feed Anywhere in your Site</title>
		<link>http://www.studionashvegas.com/tutorial/feed-me-bring-an-rss-feed-anywhere-in-your-site/</link>
		<comments>http://www.studionashvegas.com/tutorial/feed-me-bring-an-rss-feed-anywhere-in-your-site/#comments</comments>
		<pubDate>Thu, 16 Jun 2011 14:01:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[rss feeds]]></category>
		<category><![CDATA[SimplePie]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.studionashvegas.com/tutorial/feed-me-bring-an-rss-feed-anywhere-in-your-site/</guid>
		<description><![CDATA[<p>Posted in <a href="http://www.studionashvegas.com/category/tutorial/" title="Tutorial">Tutorial</a></p>Many of us are guilty of running multiple blogs – we have personal blogs, work blogs, and even blogs for our pets.&#160;]]></description>
			<content:encoded><![CDATA[<p>Posted in <a href="http://www.studionashvegas.com/category/tutorial/" title="Tutorial">Tutorial</a></p><p>Many of us are guilty of running multiple blogs – we have personal blogs, work blogs, and even blogs for our pets.&nbsp; If you’re like me, however, you still like to show the different sides of yourself around your different sites.&nbsp; WordPress’ built in RSS Widget does a great job at bringing external feeds into your site, but what if you want a little more control?&nbsp; And what if you don’t want to constrain the feed to a widget, but give it a spot of prominence in a page template?&nbsp; Well, that’s where <a href="http://simplepie.org/">SimplePie</a> comes in – and the best part: it’s built into WordPress.</p>
<p><a href="http://simplepie.org/">SimplePie</a> is a very simple (hence the name) implementation of a php script used to scrape (fetch) a feed and display its contents.</p>
<p>Below is a self-made modification of the RSS sample given on the codex; this is a simple start, but it allows you to modify it like a typical WordPress loop (and structures it very similarly):</p>
<p><font face="Courier New">&lt;?php if(function_exists(&#8216;fetch_feed&#8217;)) {<br />include_once(ABSPATH.WPINC.&#8217;/feed.php&#8217;);<br />$feed = fetch_feed(&#8216;#&#8217;); // Replace the hash mark with your feed URL<br />$limit = $feed-&gt;get_item_quantity(3); // specify number of items to show<br />$items = $feed-&gt;get_items(0, $limit); // create an array of items<br />}<br />if ($limit == 0) echo &#8216;&lt;div&gt;The feed is either empty or unavailable.&lt;/div&gt;&#8217;; // Message to show if 0 items in feed<br />else foreach ($items as $item) : ?&gt;<br /></font><font face="Courier New">&lt;div class=&#8221;post&#8221;&gt;<br />&lt;a class=&#8221;rsswidget&#8221; href=&#8221;&lt;?php echo $item-&gt;get_permalink(); ?&gt;&#8221;<br />title=&#8221;&lt;?php echo $item-&gt;get_date(&#8216;F j Y @ g:i a&#8217;); ?&gt;&#8221;&gt;&lt;h2&gt;&lt;?php echo $item-&gt;get_title(); ?&gt;&lt;/h2&gt;&lt;/a&gt;<br />&lt;p&gt;&lt;?php echo $item-&gt;get_date(&#8216;F j Y&#8217;); ?&gt;&lt;/p&gt;<br />&lt;div class=&#8221;entry&#8221;&gt;<br />&lt;?php echo substr($item-&gt;get_description(), 0, 100); ?&gt; // change 100 to number of characters to show<br />&lt;a class=&#8221;fullpost&#8221; href=&#8221;&lt;?php echo $item-&gt;get_permalink(); ?&gt;&#8221;&gt;read more&lt;/a&gt;<br />&lt;/div&gt;<br />&lt;/div&gt;<br />&lt;?php endforeach; ?&gt; </font></p>
]]></content:encoded>
			<wfw:commentRss>http://www.studionashvegas.com/tutorial/feed-me-bring-an-rss-feed-anywhere-in-your-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exclude Non-Standard Post Formats from the WordPress Post Count</title>
		<link>http://www.studionashvegas.com/tutorial/exclude-non-standard-post-formats-from-the-wordpress-post-count/</link>
		<comments>http://www.studionashvegas.com/tutorial/exclude-non-standard-post-formats-from-the-wordpress-post-count/#comments</comments>
		<pubDate>Thu, 24 Feb 2011 04:04:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[post formats]]></category>
		<category><![CDATA[WordPress 3.1]]></category>

		<guid isPermaLink="false">http://www.studionashvegas.com/tutorial/exclude-non-standard-post-formats-from-the-wordpress-post-count/</guid>
		<description><![CDATA[<p>Posted in <a href="http://www.studionashvegas.com/category/tutorial/" title="Tutorial">Tutorial</a></p>I’ve been diving into WordPress’ new post-formats lately, and was able to quickly implement some of the new features]]></description>
			<content:encoded><![CDATA[<p>Posted in <a href="http://www.studionashvegas.com/category/tutorial/" title="Tutorial">Tutorial</a></p><p>I’ve been diving into WordPress’ new post-formats lately, and was able to quickly implement some of the new features into the site.  I’ve really taken hold of two post formats: statuses (like a facebook status or a tweet) and links (to non-studionashvegas news, mostly from the WordPress world).  But, I got to thinking – these statuses are great, but they’re taking away from blog content.  I’d love to use them, but with every status or link I post I take off one post from my blog archive – the default setting is 10, and that’s not much in terms of real estate for blog posts.</p>
<p>I wondered if there was a way to <strong>manually</strong> tick off a counter when a standard<em> </em>post was used, but to <strong>skip the counter </strong>when a non-standard post format was used – that way there would always be 10 standard posts, but I could intersperse other content in without sacrificing a blog post on the front page.</p>
<p>My search took me to DigWP and <a href="http://digwp.com/2009/12/limit-posts-without-plugin/" target="_blank">an article they wrote a few years ago</a>. In it, they talk of using a counter variable and adding one to it when the post is over:</p>
<blockquote><p>&lt;?php <strong>$i = 1</strong>; while (have_posts() <strong>&amp;&amp; $i &lt; 6</strong>) : the_post(); ?&gt;<br />
&lt;h1&gt;&lt;a href=&#8221;&lt;?php the_permalink(); ?&gt;&#8221;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h1&gt;<br />
&lt;p&gt;?php the_time(); ?&gt;&lt;/p&gt;<br />
&lt;?php the_content(); ?&gt;<br />
&lt;p&gt;&lt;?php the_tags(); ?&gt;&lt;/p&gt;<br />
&lt;?php <strong>$i++</strong>; endwhile; ?&gt;<br />
…other stuff…<br />
&lt;?php endif; ?&gt;</p></blockquote>
<p>I’ve hit the high points in bold.  Basically they create a counter variable, set it to 1, and then require it to be less than a number (6 here).  Once the post has run, it ticks the counter, then heads back to loop around again.  If it’s at 6, it stops before it runs.  Fair enough – that does it.</p>
<p>Next I turn to Lisa Sabin-Wilson’s <a href="http://lisasabin-wilson.com/wordpress-3-1-post-formats-reference" target="_blank">reference on post formats</a> (fantastic resource, by the way).  It uses the “has_post_format” tag to check for specific post formats.  Using that template, plus my own loop, I figured out how to do it.  Be wary, though, this isn’t for the non-code literate; know your code or at least back up your stuff before you do this <img src='http://cdn.studionashvegas.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  (you’ve been warned).</p>
<h3>Step 1: Define our Post Formats</h3>
<blockquote><p>add_theme_support( &#8216;post-formats&#8217;, array( &#8216;link&#8217;, &#8216;status&#8217; ) );</p></blockquote>
<p>The “add_theme_support” tag is used with the post-formats variable.  I only want two types (link and status) but if I need to I can always add more later.</p>
<h3>Step 2: Edit our Loop</h3>
<p>This is where things get tricky.  I’m going to paste my loop in its entirety and walk you through it (keep in mind this is written in HTML5-ish code):</p>
<blockquote><p>&lt;?php if (have_posts()) : ?&gt; &lt;?php <span style="color: #ff0000;">$i = 1;</span> while (have_posts() &amp;&amp; <span style="color: #ff0000;">$i &lt; 11</span>) : the_post(); ?&gt;<br />
<span style="color: #9c85c0;">&lt;?php if ( has_post_format( &#8216;link&#8217; )) { ?&gt;&lt;div class=&#8221;clear&#8221;&gt;&lt;/div&gt;<br />
&lt;article&gt;<br />
&lt;div id=&#8221;post-&lt;?php the_ID(); ?&gt;&#8221; &lt;?php post_class(); ?&gt;&gt;<br />
&lt;h2&gt;&lt;?php the_title(); ?&gt;&lt;/h2&gt;<br />
&lt;div class=&#8221;entry&#8221;&gt;<br />
&lt;?php the_content(); ?&gt;<br />
&lt;/div&gt;<br />
&lt;div class=&#8221;newsmeta&#8221;&gt;&lt;a href=&#8221;&lt;?php $key=&#8221;source&#8221;; echo get_post_meta($post-&gt;ID, $key, true); ?&gt;&#8221;&gt;Original Source&lt;/a&gt;&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;/article&gt;<br />
</span><span style="color: #9c85c0;">&lt;?php } elseif ( has_post_format( &#8216;status&#8217;)) { ?&gt;<br />
</span><span style="color: #9c85c0;">&lt;div id=&#8221;post-&lt;?php the_ID(); ?&gt;&#8221; &lt;?php post_class(); ?&gt;&gt;<br />
&lt;?php the_content(); ?&gt;<br />
&lt;/div&gt;<br />
</span><span style="color: #9c85c0;">&lt;?php } else { ?&gt;</span>&lt;div class=&#8221;clear&#8221;&gt;&lt;/div&gt;<br />
&lt;article&gt;<br />
&lt;div id=&#8221;post-&lt;?php the_ID(); ?&gt;&#8221; &lt;?php post_class(); ?&gt;&gt;<br />
&lt;h2&gt;&lt;a href=&#8221;&lt;?php the_permalink() ?&gt;&#8221; rel=&#8221;bookmark&#8221; title=&#8221;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&#8221;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;<br />
&lt;div class=&#8221;entry&#8221;&gt;<br />
&lt;?php the_post_thumbnail( &#8216;blogthumb&#8217; ); ?&gt;<br />
&lt;?php the_excerpt(); ?&gt;<br />
<span style="color: #ff0000;">&lt;?php $i++; ?&gt;<br />
</span>&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;/article&gt;<br />
<span style="color: #9c85c0;">&lt;?php } ?&gt;<br />
</span>&lt;?php endwhile; ?&gt;</p>
<p>…other stuff…</p>
<p>&lt;?php endif; ?&gt;</p></blockquote>
<p>Confusing yet?  I’ve broken the new stuff into two colors: the counter and the post-formats code.  The red is the same counter code used in DigWP’s code.  The lavendar/lilac/light-purple is the post-format code.  Notice how I start it off with the has_post_format tag:</p>
<blockquote><p><span style="color: #9c85c0;">&lt;?php if ( has_post_format( &#8216;link&#8217; )) { ?&gt;</span></p></blockquote>
<p>That checks to see what post format I have and displays the loop stuff accordingly.  There’s also an elseif later on that checks for the status, then a final else to display standard (or other, undefined post types) later on.  Then, it displays the normal article stuff.</p>
<p>The key to note is that I’ve included the $i++ under the excerpt on the “standard” articles – this ticks the counter before it returns to the top to do it all over again.</p>
<h3>One Caveat I’ve Noticed…</h3>
<p>The WordPress Default “Posts Per Page” option will over-ride the counter every time.  So, I ended up setting mine to 20.  I don’t plan on having more than a few “other types of posts” so this is a good number.</p>
<h3>How I Can Improve</h3>
<p>I’d rather hook this into the main “posts per page” option, but for right now I’m really not sure on how to do that – this will work for now, however.  And, it gives me the control I need and allows me to utilize those new post formats without sacrificing my real content.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.studionashvegas.com/tutorial/exclude-non-standard-post-formats-from-the-wordpress-post-count/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom Category Styles</title>
		<link>http://www.studionashvegas.com/tutorial/custom-category-styles/</link>
		<comments>http://www.studionashvegas.com/tutorial/custom-category-styles/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 15:30:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.studionashvegas.com/?p=1258</guid>
		<description><![CDATA[<p>Posted in <a href="http://www.studionashvegas.com/category/tutorial/" title="Tutorial">Tutorial</a></p>I had a few people ask me yesterday how I was able to separate the styles on my blog into normal posts and the “asides” post]]></description>
			<content:encoded><![CDATA[<p>Posted in <a href="http://www.studionashvegas.com/category/tutorial/" title="Tutorial">Tutorial</a></p><p>I had a few people ask me yesterday how I was able to separate the styles on my blog into normal posts and the “asides” post – news from WordPress, etc.  It’s not hard, so I thought I would share it with you.<a href="http://cdn.studionashvegas.com/wp-content/uploads/2011/02/image.png" rel="shadowbox[sbpost-1258];player=img;"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://cdn.studionashvegas.com/wp-content/uploads/2011/02/image_thumb.png" border="0" alt="image" width="620" height="443" /></a></p>
<p>First off, you need to make sure that your posts have the dynamic categories that can be assigned by WordPress.  This is done by replacing:</p>
<p><code> </code></p>
<p>&lt;div id=&#8221;post-&lt;?php the_ID(); ?&gt;&#8221; &lt;?php post_class(); ?&gt;&gt;</p>
<p>with</p>
<p><code> </code></p>
<p>&lt;div id=&#8221;post-&lt;?php the_ID(); ?&gt;&#8221;&gt;</p>
<p>WordPress adds in (using post_class) quite a few classes that will allow you target posts with CSS by tag, category, or even post type.  Once this is in, we find out the category name for our post and style it accordingly:</p>
<p><code> </code></p>
<p>.blog .category-asides{padding: 20px !important;background: #e6e6e6 url(http://www.studionashvegas.com/wp-content/uploads/2011/02/news-bg.jpg) no-repeat bottom right;position: relative;}</p>
<p>I’ve given it padding, and some background edits (such as a color and background image – the WordPress logo).</p>
<p>Now, I don’t want people to find their way into the single article on these “asides” posts – they have the original source quoted in the story and I’m disabling the ability to click through on the title.  That means we need to change the code in the loop.</p>
<p>Open the index.php file and look for this statement:</p>
<p><code> </code></p>
<p>&lt;h2&gt;&lt;a href=&#8221;&lt;?php the_permalink() ?&gt;&#8221; rel=&#8221;bookmark&#8221; title=&#8221;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&#8221;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;</p>
<p>We’re going to use a conditional tag to check which category it’s in.  If it’s in our asides category (in this case, category ID #6) then we use a specific code.  Otherwise, it displays as normal:</p>
<p><code> </code></p>
<p>&lt;?php if (in_category(&#8217;6&#8242;)) { ?&gt;&lt;h2&gt;&lt;?php the_title(); ?&gt;&lt;/h2&gt;&lt;?php } else { ?&gt;&lt;h2&gt;&lt;a href=&#8221;&lt;?php the_permalink() ?&gt;&#8221; rel=&#8221;bookmark&#8221; title=&#8221;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&#8221;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;&lt;?php } ?&gt;</p>
<p>Notice the first part contains just the title, while the second contains a hyperlinked title.</p>
<p>One last thing I want to do is to display a link to the original source.  I want people to see quickly that I “reblogged” this from another site and that it’s just a new posting – not original content from me.  So, I used another conditional tag (this one goes right below<br />
&lt;?php the_content(); ?&gt;):</p>
<p><code> </code></p>
<p>&lt;?php if (in_category(&#8217;6&#8242;)) { ?&gt;&lt;div class=&#8221;newsmeta&#8221;&gt;&lt;a href=&#8221;&lt;?php $key=&#8221;source&#8221;; echo get_post_meta($post-&gt;ID, $key, true); ?&gt;&#8221;&gt;Original Source&lt;/a&gt;&lt;/div&gt;&lt;?php } else { ?&gt;&lt;?php } ?&gt;</p>
<p>See that php code starting with $key? That’s a variable.  Basically, I’m asking WordPress to(for this loop only) assign a value to that variable.  But where am I pulling from?  Why, a custom field, of course!  This allows me to echo the “post_meta” (or custom field) labeled “source”.  In the post editor, I paste in a URL and it puts in a nice link that links to the original article.</p>
<p>I also gave it a bit of formatting to make it look nice:<code><br />
</code>.newsmeta{position: absolute;right: 50px;bottom: 10px;font-size: 11px;text-align: right;font-style: italic;}</p>
<p>.newsmeta a{font-style: italic;font-size: 10px;}</p>
<p>And that’s it – by separating the content you can make certain categories look and even operate<br />
differently than other posts.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.studionashvegas.com/tutorial/custom-category-styles/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adding a Facebook “Like” Button to WordPress – the (Somewhat) Easy Way</title>
		<link>http://www.studionashvegas.com/wordpress/adding-a-facebook-like-button-to-wordpress-the-somewhat-easy-way/</link>
		<comments>http://www.studionashvegas.com/wordpress/adding-a-facebook-like-button-to-wordpress-the-somewhat-easy-way/#comments</comments>
		<pubDate>Sat, 24 Apr 2010 04:44:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[facebook like button]]></category>
		<category><![CDATA[opengraph]]></category>

		<guid isPermaLink="false">http://www.studionashvegas.com/wordpress/adding-a-facebook-like-button-to-wordpress-the-somewhat-easy-way/</guid>
		<description><![CDATA[<p>Posted in <a href="http://www.studionashvegas.com/category/tutorial/" title="Tutorial">Tutorial</a><a href="http://www.studionashvegas.com/category/wordpress/" title="WordPress">WordPress</a></p>UPDATE: I managed to write this into a plugin – Facebook Like Button
Since Facebook announced a few days ago that you would]]></description>
			<content:encoded><![CDATA[<p>Posted in <a href="http://www.studionashvegas.com/category/tutorial/" title="Tutorial">Tutorial</a><a href="http://www.studionashvegas.com/category/wordpress/" title="WordPress">WordPress</a></p><p><em>UPDATE: I managed to write this into a plugin – <a href="http://www.studionashvegas.com/?p=834" target="_blank">Facebook Like Button</a></em></p>
<p>Since Facebook announced a few days ago that you would be able to use its OpenGraph technology to “like” pretty much anything on the Internet, I took it upon myself to test out a few solutions for adding a “Like” button on the site.</p>
<p>It turned out to be fairly easy, but not as easy as just adding a plugin and doing forth (at least, it’s not yet, anyway).</p>
<h3>Our Plan of Action:</h3>
<ol>
<li>Download and Install the plugin
<li>Editing the core file to allow for correct width and color scheme</li>
</ol>
<h2>Step 1: Downoading the Plugin</h2>
<p>I looked through quite a bit of plugins to find this one, and I had to get it from his website because it’s an alpha release, but the <a href="http://www.allanjosephbatac.com/blog/2010/04/add-the-new-facebook-like-button-widget-plugin-on-your-wordpress-blog.html" target="_blank"><strong>Facebook Like Widget</strong></a><strong>&nbsp;</strong>does it cleanly and with little fuss.</p>
<h2>Step 2: Customizing the Plugin</h2>
<p>OK.&nbsp; Editors note: normally I do not advocate editing the core of a plugin.&nbsp; Why? Because when you update (and you should!) it will over-write what you did.&nbsp; However, since this is an alpha release, and I’m almost positive the next changes will allow you <em>easily </em>do these changes, I think once or twice is ok.</p>
<p>You’re going to want to click into Plugins &gt; Editor, and choose the “Facebook Like Widget” plugin from the list.</p>
<p>There’s literally about 20 lines of code:</p>
<p><em>&lt;?php<br />/*<br />Plugin Name: Facebook Like Widget<br />Plugin URI: </em><a href="http://allanjosephbatac.com"><em>http://allanjosephbatac.com</em></a><br /><em>Description: Add a Facebook &#8216;Like&#8217; Button Widget to your post pages. Increase visitors!<br />Author: AJ Batac<br />Version: 0.1<br />Author URI: </em><a href="http://allanjosephbatac.com"><em>http://allanjosephbatac.com</em></a><br /><em>*/ </em>
<p><em>function add_facebook_like($the_iframe = &#8221;)<br />{<br />&nbsp;&nbsp;&nbsp; $the_perma&nbsp;&nbsp;&nbsp; = rawurlencode(get_permalink());<br />&nbsp;&nbsp;&nbsp; $the_iframe&nbsp;&nbsp;&nbsp; .= &#8216;&lt;div id=&#8221;facebook_like&#8221;&gt;&lt;iframe src=&#8221;</em><em>http://www.facebook.com/plugins/like.php?href=&#8217;</em><em>.$the_perma.&#8217;&amp;amp;layout=standard&amp;amp;show-faces=true&amp;amp;<strong><font color="#00ff00">width=600</font></strong>&amp;amp;action=like&amp;amp;font=arial&amp;amp;<strong><font color="#ffff00">colorscheme=dark</font></strong>&#8221; scrolling=&#8221;no&#8221; frameborder=&#8221;0&#8243; allowTransparency=&#8221;true&#8221; style=&#8221;border:none; overflow:hidden; <strong><font color="#00ff00">width:600px</font></strong>; height:auto;&#8221;&gt;&lt;/iframe&gt;&lt;/div&gt;&#8217;;<br />&nbsp;&nbsp;&nbsp; return $the_iframe;<br />} </em>
<p><em>add_action(&#8216;the_content&#8217;, &#8216;add_facebook_like&#8217;);<br />?&gt;</em></p>
<p>The bold, color coded areas above show the areas you can change. The width corresponds to how wide your blog is.&nbsp; if you don’t know, then just leave it at the default (450px) and you should be OK.&nbsp; However, your friend’s “faces” won’t go to the edge of your content.&nbsp; In yellow is the “color scheme”.&nbsp; If you have a light background, choose “light”.&nbsp; If you have a darker background, like my site, choose “dark”.&nbsp; </p>
<p>That’s it – the like badge will show up at the bottom:</p>
<p><a href="http://cdn.studionashvegas.com/wp-content/uploads/2010/04/image3.png" rel="shadowbox[sbpost-829];player=img;"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://cdn.studionashvegas.com/wp-content/uploads/2010/04/image_thumb3.png" width="600" height="382"></a> </p>
<p>And will also show up on your friend’s “Recent Activity” stream:</p>
<p><a href="http://cdn.studionashvegas.com/wp-content/uploads/2010/04/Capture.png" rel="shadowbox[sbpost-829];player=img;"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Capture" border="0" alt="Capture" src="http://cdn.studionashvegas.com/wp-content/uploads/2010/04/Capture_thumb.png" width="600" height="237"></a> </p>
</p>
<p>Keep in mind, this is not the most elegant solution, but until others come, this is a great way to get it on your site quickly and with very little editing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.studionashvegas.com/wordpress/adding-a-facebook-like-button-to-wordpress-the-somewhat-easy-way/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: basic
Database Caching 11/74 queries in 0.064 seconds using disk: basic
Object Caching 1512/1652 objects using disk: basic
Content Delivery Network via cdn.studionashvegas.com

Served from: www.studionashvegas.com @ 2012-02-08 18:59:32 -->
