<?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>Christi Richards</title>
	<atom:link href="http://www.christirichards.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.christirichards.com</link>
	<description>Personal blog and portfolio of web designer and developer Christi Richards</description>
	<lastBuildDate>Fri, 17 May 2013 00:16:08 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>It&#8217;s Like a Drug</title>
		<link>http://www.christirichards.com/its-like-a-drug/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=its-like-a-drug</link>
		<comments>http://www.christirichards.com/its-like-a-drug/#comments</comments>
		<pubDate>Fri, 17 May 2013 00:14:19 +0000</pubDate>
		<dc:creator>Christi Richards</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.christirichards.com/?p=537</guid>
		<description><![CDATA[]]></description>
				<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://www.christirichards.com/its-like-a-drug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Related Topics Plugin</title>
		<link>http://www.christirichards.com/wordpress-related-topics-plugin/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wordpress-related-topics-plugin</link>
		<comments>http://www.christirichards.com/wordpress-related-topics-plugin/#comments</comments>
		<pubDate>Sat, 28 Jul 2012 22:30:44 +0000</pubDate>
		<dc:creator>Christi Richards</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[$wp_query]]></category>
		<category><![CDATA[associative array]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[custom post type]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[plugin development]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[related terms]]></category>
		<category><![CDATA[related topics]]></category>
		<category><![CDATA[taxonomy]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://christirichards.com/?p=44</guid>
		<description><![CDATA[Plugin development walkthrough and tutorial for Wordpress that displays the related topics (terms) of a custom post type. Full code/plugin available for download.]]></description>
				<content:encoded><![CDATA[<p>For a recent WordPress project I was working on I needed a way to display related taxonomies (topics) from a custom post type within a single taxonomy template.  For this specific project, my custom post type was &#8216;video&#8217; and its taxonomy was &#8216;topics&#8217;.  For each taxonomy page I wanted to show a list of topics related to the video posts they had been tagged in.  </p>
<h3>Getting Started</h3>
<p>First I needed to begin a new $wp_query with the settings below:</p><pre class="crayon-plain-tag">$term_slug = get_queried_object()-&gt;slug;
$wp_query = new WP_Query;
$args = array(
    // Related Topics based on the current topic
    'post_type'      =&gt; 'video',  // Video post type
    'post_status'    =&gt; 'publish', // Only check published posts
    'posts_per_page' =&gt; 10,       
    // Query the taxonomy
    'tax_query'      =&gt; array(
        array(
            'taxonomy' =&gt; 'topics', // Checks all the topics associated to the term
            'field'    =&gt; 'slug',
            'terms'    =&gt; $term_slug, // The term slug
        )
    )
);</pre><p>
<p>Next I want to pass these $args and find the relational terms for each post containing my term slug.</p>
<p>To view our progress at this point, a print_r($related) will show an array of topics and the number of times it has appeared.  Success! But not quite there yet.</p><pre class="crayon-plain-tag">$results = $wp_query-&gt;query( $args );

$related = array();

if( count( $results ) &gt; 0 ) {
    foreach( $results as $result ) {
        $new_related = get_the_terms( $result-&gt;ID, 'topics' ); 
        if( is_array( $new_related ) ) {
            foreach( $new_related as $v ) {
                $name = $v-&gt;name;
                if( array_key_exists( $name, $related ) )
                    $related[$name]++; // Add to total if existing
                else
                    $related[$name] = 1; // Initialize if it does not exist
            }
        }
    }  
	
    arsort( $related, SORT_NUMERIC ); // Sort the array numerically
}</pre><p>
<p>So next I need to do few things.  </p>
<ol>
<li>I want to sort the output into a list and make it pretty.</li>
<li>I only want to display 10 results.</li>
<li>Out of these 10 results, I do not want to show the topic of the page I am currently on.</li>
<li>If you did a print_r of the array, you&#8217;ll see that the output is not formatted for direct insertion into a URL, so I will need to remove the whitespace of this result and enter a hyphen for use again as a term slug.  This is easily achieved with a str_replace and trim.</li>
</ol>
<pre class="crayon-plain-tag">echo &quot;&lt;div class='related_topics'&gt;&lt;h3&gt;&lt;strong&gt;Related&lt;/strong&gt; Topics&lt;/h3&gt;&quot;;

     echo &quot;&lt;ul&gt;&quot;;

	ob_start(); // Grab $current_term from the echo
	  $current_term = single_term_title();
	  echo $current_term;
	  $redundant_term = ob_get_contents();
	ob_end_clean();
	
	$i = 0;  // Start at zero
	 foreach ($related as $key =&gt; $value)  {  // Get our pairs so we can grab the key
	  if ($key == $redundant_term) {  // If key is current term - skip it
		continue; }
	  if(++$i &gt; 10) {
	        break; } // Break at 10 results
	
       // Remove whitespace and replace with hyphens for post slug
	 $clean = str_replace(' ','-',trim($key)); 
	 
     echo &quot;&lt;li&gt;&lt;a href='&quot;.&quot;/topics/&quot;. $clean .&quot;'&gt;$key&lt;/a&gt;&quot;;  // Print out URL and regular version in a list
	
     echo &quot;&lt;/li&gt;&quot;;  }  
	
     echo &quot;&lt;/ul&gt;&quot;;
	
     echo &quot;&lt;/div&gt;&quot;;</pre>
<h3>Finishing Up</h3>
<p>Since this was something I wanted to show in a custom sidebar of my taxonomy template, I opted for creating a custom plugin.  I didn&#8217;t need any options with the plugin, just a quick solution, so I just wrapped it up in a function to do what I needed.</p>
<p>Here is the final result:</p>
<pre class="crayon-plain-tag">//Related Topics Function
function related_topics() {

$term_slug = get_queried_object()-&gt;slug;
$wp_query = new WP_Query;
$args = array(
    // Related Topics based on the current topic
    'post_type'      =&gt; 'video',  // Video post type
    'post_status'    =&gt; 'publish', // Only check published posts
    'posts_per_page' =&gt; 10,       
    // Query the taxonomy
    'tax_query'      =&gt; array(
        array(
            'taxonomy' =&gt; 'topics', // Checks all the topics associated to the term
            'field'    =&gt; 'slug',
            'terms'    =&gt; $term_slug, // The term slug
        )
    )
);

$results = $wp_query-&gt;query( $args );

$related = array();

if( count( $results ) &gt; 0 ) {
    foreach( $results as $result ) {
        $new_related = get_the_terms( $result-&gt;ID, 'topics' ); 
        if( is_array( $new_related ) ) {
            foreach( $new_related as $v ) {
                $name = $v-&gt;name;
                if( array_key_exists( $name, $related ) )
                    $related[$name]++; // Add to total if existing
                else
                    $related[$name] = 1; // Initialize if it does not exist
            }
        }
    }  
	
    arsort( $related, SORT_NUMERIC ); // Sort the array numerically
}

echo &quot;&lt;div class='related_topics'&gt;&lt;h3&gt;&lt;strong&gt;Related&lt;/strong&gt; Topics&lt;/h3&gt;&quot;;

     echo &quot;&lt;ul&gt;&quot;;

	ob_start(); // Grab $current_term from the echo
	  $current_term = single_term_title();
	  echo $current_term;
	  $redundant_term = ob_get_contents();
	ob_end_clean();
	
	$i = 0;  // Start at zero
	 foreach ($related as $key =&gt; $value)  {  // Get our pairs so we can grab the key
	  if ($key == $redundant_term) {  // If key is current term - skip it
		continue; }
	  if(++$i &gt; 10) {
	        break; } // Break at 10 results
	
       // Remove whitespace and replace with hyphens for post slug
	 $clean = str_replace(' ','-',trim($key)); 
	 
     echo &quot;&lt;li&gt;&lt;a href='&quot;.&quot;/topics/&quot;. $clean .&quot;'&gt;$key&lt;/a&gt;&quot;;  // Print out URL and regular version in a list
	
     echo &quot;&lt;/li&gt;&quot;;  }  
	
     echo &quot;&lt;/ul&gt;&quot;;
	
     echo &quot;&lt;/div&gt;&quot;;
}</pre>
<p>Here is the final plugin version tested on WordPress 3.4.1.  Since I didn&#8217;t need an options page, you&#8217;ll need to edit the file with your own custom post type and taxonomy to make it work.  Feel free to change it to suit your needs or expand upon it.</p>
<a class="prettylink zip"  href="http://www.christirichards.com/wp-content/uploads/2012/03/Related-Topics-1.0.zip">Download WordPress Related Topics Plugin &#8211; 1.0</a>
<p>If you have any questions, comments, concerns (or criticisms) &#8211; leave a comment below.</p>
<p><em><small>Special thanks to <a href="http://wordpress.stackexchange.com/users/11740/m0r7if3r" target="_blank">M0R7IF3R</a> over at WordPress Answers for his help pointing me in the right direction with this plugin.</small></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.christirichards.com/wordpress-related-topics-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Saying &#8216;NO&#8217; to Boring Lipsum Placeholders</title>
		<link>http://www.christirichards.com/saying-no-to-boring-lipsum/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=saying-no-to-boring-lipsum</link>
		<comments>http://www.christirichards.com/saying-no-to-boring-lipsum/#comments</comments>
		<pubDate>Sat, 28 Jul 2012 12:00:51 +0000</pubDate>
		<dc:creator>Christi Richards</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[design resources]]></category>
		<category><![CDATA[dummy content]]></category>
		<category><![CDATA[dummy text]]></category>
		<category><![CDATA[greeking]]></category>
		<category><![CDATA[lorem ipsum]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://christirichards.com/?p=1</guid>
		<description><![CDATA[When traditional Lorem Ipsum isn't for you - here's the ultimate list of unique and amusing Lipsum generators to fill out any design mockup.]]></description>
				<content:encoded><![CDATA[<p>When traditional Lorem Ipsum isn&#8217;t for you &#8211; here&#8217;s the ultimate list of unique and amusing Lipsum generators to fill out any design.</p>
<h3><a href="http://baconipsum.com" target="_blank">Bacon Ipsum</a></h3>
<p>Love meat? <a href="http://baconipsum.com" target="_blank">Bacon Ipsum</a> provides everything you need for some hearty filler text with a side shank of pork.</p>
<p><a href="http://baconipsum.com" target="_blank"><img class="aligncenter size-large wp-image-281" title="Bacon Ipsum" src="http://www.christirichards.com/wp-content/uploads/2012/03/bacon-ipsum-550x391.png" alt="Bacon Ipsum" width="550" height="391" /></a></p>
<blockquote><p>Pig filet mignon shank, shoulder beef corned beef brisket ground round pancetta ham. Pancetta capicola filet mignon, swine jowl rump cow bacon drumstick. Ribeye short ribs chicken, ham pork loin pancetta pork shank turkey. Flank bacon pastrami, pancetta tri-tip tail ball tip ham hock pork loin ribeye t-bone beef spare ribs pork chop. Brisket short ribs pork loin, bacon swine andouille filet mignon bresaola beef t-bone. Ground round meatloaf tenderloin ball tip, flank jowl boudin leberkas pork ham hock bresaola bacon.</p></blockquote>
<h3><a href="http://cupcakeipsum.com/" target="_blank">Cupcake Ipsum</a></h3>
<p>The cutest of all lipsum generators so far, <a href="http://cupcakeipsum.com/" target="_blank">Cupcake Ipsum</a> fills your page with sweet and sugary treats.</p>
<p><a href="http://cupcakeipsum.com/" target="_blank"><img class="aligncenter size-large wp-image-267" title="Cupcake Ipsum" src="http://www.christirichards.com/wp-content/uploads/2012/03/cupcake-ipsum-550x391.png" alt="Cupcake Ipsum" width="550" height="391" /></a></p>
<blockquote><p>Candy canes jelly beans candy sweet chocolate tart bear claw gingerbread. Toffee fruitcake chupa chups cookie donut toffee. Cheesecake bonbon biscuit sweet toffee gummies. Cupcake brownie lemon drops gummi bears sugar plum caramels applicake. Danish icing danish. Tootsie roll sesame snaps cotton candy. Marshmallow oat cake caramels chocolate. Gingerbread chocolate cotton candy sweet cotton candy cupcake bear claw danish powder.</p></blockquote>
<h3><a href="http://chrisvalleskey.com/fillerama/" target="_blank">Fillerama</a></h3>
<p>Fillerama provides snippets from various TV shows as filler text. Shows include: Doctor Who, Dexter, Futurama, Monty Python and the Holy Grail, The Simpsons, and Star Wars.</p>
<p><a href="http://chrisvalleskey.com/fillerama/" target="_blank"><img class="aligncenter size-large wp-image-282" title="Fillerama" src="http://www.christirichards.com/wp-content/uploads/2012/03/fillerama-550x391.png" alt="Fillerama" width="550" height="391" /></a></p>
<blockquote><p>Yes. You gave me a dollar and some candy. I&#8217;ve got to find a way to escape the horrible ravages of youth. Suddenly, I&#8217;m going to the bathroom like clockwork, every three hours. And those jerks at Social Security stopped sending me checks. Now &#8216;I&#8221; have to pay &#8221;them&#8217;! Who said that? SURE you can die! You want to die?! Look, everyone wants to be like Germany, but do we really have the pure strength of &#8216;will&#8217;?</p></blockquote>
<h3><a href="http://www.fillerati.com" target="_blank">Fillerati</a></h3>
<p>If you love classical literature, then <a href="http://www.fillerati.com" target="_blank">Fillerati</a> is for you. One of my favorite generators, it includes excerpts from titles such as Alice in Wonderland and Moby dick to elegantly fill any page.</p>
<p><a href="http://www.fillerati.com" target="_blank"><img class="aligncenter size-large wp-image-269" title="Fillerati" src="http://www.christirichards.com/wp-content/uploads/2012/03/fillerati-550x391.png" alt="Fillerati" width="550" height="391" /></a></p>
<blockquote><p>&#8216;And who are THESE?&#8217; said the Queen, pointing to the three gardeners who were lying round the rosetree; for, you see, as they were lying on their faces, and the pattern on their backs was the same as the rest of the pack, she could not tell whether they were gardeners, or soldiers, or courtiers, or three of her own children.</p></blockquote>
<h3><a href="http://hairylipsum.com" target="_blank">Hairy Lipsum Generator</a></h3>
<p>The <a href="http://hairylipsum.com" target="_blank">Hairy Lipsum Generator</a> will give your next project a boost in manliness by 100% -GUARANTEED!</p>
<p><a href="http://hairylipsum.com" target="_blank"><img class="aligncenter size-large wp-image-284" title="Hairy Lipsum Generator" src="http://www.christirichards.com/wp-content/uploads/2012/03/hairy-lipsum-550x391.png" alt="Hairy Lipsum Generator" width="550" height="391" /></a></p>
<blockquote><p>Albert einstein mustachio hello, we’re cockneys devilish cad et stache, et cesar romero borat toothbrush funny walk mustachio hungarian devilish cad albert einstein hold steady keyboardist elit stache Freddie mercury hello, we’re cockneys, mustachio Refined gentlemen borat toothbrush elit don’t panic funny walk driving gloves et hello, we’re cockneys stache hungarian hungarian Freddie mercury hold steady keyboardist cesar romero devilish cad lando calrissian albert einstein.</p></blockquote>
<h3><a href="http://www.slipsum.com/" target="_blank">Samuel L. Ipsum</a></h3>
<p>Looking for some motherf*cking placeholder text? Look no further &#8211; It&#8217;s <a href="http://www.slipsum.com/" target="_blank">Samuel L. Ipsum</a>.</p>
<p><a href="http://www.slipsum.com/" target="_blank"><img class="aligncenter size-large wp-image-274" title="Samuel L. Ipsum" src="http://www.christirichards.com/wp-content/uploads/2012/03/samuel-l-ipsum-550x391.png" alt="Samuel L. Ipsum" width="550" height="391" /></a></p>
<blockquote><p>Do you see any Teletubbies in here? Do you see a slender plastic tag clipped to my shirt with my name printed on it? Do you see a little Asian child with a blank expression on his face sitting outside on a mechanical helicopter that shakes when you put quarters in it? No? Well, that&#8217;s what you see at a toy store. And you must think you&#8217;re in a toy store, because you&#8217;re here shopping for an infant named Jeb.</p></blockquote>
<h3><a href="http://trollemipsum.appspot.com/" target="_blank">Trollem Ipsum</a></h3>
<p>When you can&#8217;t find the right words, Trollem Ipsum will help you auto-troll your next project &#8211; or Apple forum! Show those Apple fanbois and Android geeks how its done.</p>
<p><a href="http://trollemipsum.appspot.com/" target="_blank"><img class="aligncenter size-large wp-image-258" title="Trollem Ipsum" src="http://www.christirichards.com/wp-content/uploads/2012/03/trollem-ipsum-550x391.png" alt="Trollem Ipsum" width="550" height="391" /></a></p>
<blockquote><p>ICloud generally Android geek, to begin with battery life whatever profit but while Apple will only get better, because of so-called “iPad killer”, I believe user experience sucks afterwards gorgeous, although gorgeous, nevertheless iPhone rip-offs, that Steve Jobs was a genius, why gorgeous while profit, when iTunes makes it easy in the beginning profit soon so-called “iPad killer”, at the beginning Flash sucks, whenever profit I think Android sucks during delay in getting Ice Cream Sandwich after that MacBook Air is just beautiful but gorgeous, at last pleasure to use.</p></blockquote>
<h3><a href="http://www.veganipsum.com" target="_blank">Vegan Ipsum</a></h3>
<p><a href="http://www.veganipsum.com" target="_blank">Vegan Ipsum</a> provides a meat-free alternative to Bacon Ipsum.</p>
<p><a href="http://www.veganipsum.com" target="_blank"><img class="aligncenter size-large wp-image-275" title="Vegan Ipsum" src="http://www.christirichards.com/wp-content/uploads/2012/03/vegan-ipsum-550x391.png" alt="Vegan Ipsum" width="550" height="391" /></a></p>
<blockquote><p>Bitter melon turnip greens earthnut pea aubergine lizard&#8217;s tail peanut camas ginger &#8211; scorzonera nopal. Lentil greater plantain melokhia mooli? Lizard&#8217;s tail chaya elephant foot yam manioc; cress pignut guar welsh onion, sweet corn aka corn; aka maize earthnut pea garbanzo rutabaga.</p></blockquote>
<h3><a href="http://www.zombieipsum.com" target="_blank">Zombie Ipsum</a></h3>
<p><a href="http://www.zombieipsum.com" target="_blank">Zombie Ipsum</a> &#8211; now with 50% more brains!</p>
<p><a href="http://www.zombieipsum.com" target="_blank"><img class="aligncenter size-large wp-image-308" title="Zombie Ipsum" src="http://www.christirichards.com/wp-content/uploads/2012/03/zombie-ipsum-550x391.png" alt="Zombie Ipsum" width="550" height="391" /></a></p>
<blockquote><p>Zombie ipsum brains reversus ab cerebellum viral inferno, brein nam rick mend grimes malum cerveau cerebro. De carne cerebro lumbering animata cervello corpora quaeritis. Summus thalamus brains sit​​, morbo basal ganglia vel maleficia?</p></blockquote>
<h3>Honorable Mentions</h3>
<p>More great Lipsum generators to spice up your designs:</p>
<p><a href="http://beeripsum.com" target="_blank">Beer Ipsum</a><br />
<a href="http://lorizzle.nl" target="_blank">Gangsta Lorem Ipsum</a><br />
<a href="http://hipsteripsum.me" target="_blank">Hipster Ipsum</a><br />
<a href="http://tunaipsum.com" target="_blank">Tuna Ipsum</a><br />
<a href="http://tvipsum.com" target="_blank">TV Ipsum</a><br />
<a href="http://tlipsum.appspot.com" target="_blank">T&#8217;Lipsum &#8211; A Yorkshire Lorem Ipsum Generator</a><br />
<a href="http://veggieipsum.com" target="_blank">Veggie Ipsum</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.christirichards.com/saying-no-to-boring-lipsum/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Form and Function</title>
		<link>http://www.christirichards.com/form-and-function/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=form-and-function</link>
		<comments>http://www.christirichards.com/form-and-function/#comments</comments>
		<pubDate>Sun, 24 Jun 2012 23:05:35 +0000</pubDate>
		<dc:creator>Christi Richards</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[Franky Lloyd Wright]]></category>
		<category><![CDATA[quotation]]></category>

		<guid isPermaLink="false">http://www.christirichards.com/?p=515</guid>
		<description><![CDATA[]]></description>
				<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://www.christirichards.com/form-and-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

 Served from: www.christirichards.com @ 2013-05-22 15:53:58 by W3 Total Cache -->