<?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>Denver SEO Blog &#187; Code</title>
	<atom:link href="http://www.seodenver.com/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.seodenver.com</link>
	<description>Websites designed and optimized for results.</description>
	<lastBuildDate>Tue, 07 Feb 2012 17:50:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Paginate Links in WordPress Link Manager</title>
		<link>http://www.seodenver.com/paginate-links-wordpress-link-manager/</link>
		<comments>http://www.seodenver.com/paginate-links-wordpress-link-manager/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 17:50:14 +0000</pubDate>
		<dc:creator>Zack Katz</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Link Categories]]></category>
		<category><![CDATA[Link Manager]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[Pagination]]></category>
		<category><![CDATA[Wordpress Customization]]></category>

		<guid isPermaLink="false">http://www.seodenver.com/?p=2213</guid>
		<description><![CDATA[Links are not a first-class citizens in WordPress In developing the a website for professional genealogists, I was tasked with creating link directory functionality in WordPress. I didn&#8217;t want to install some big plugins; I wanted to use the Links Manager &#8230; <a href="http://www.seodenver.com/paginate-links-wordpress-link-manager/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://www.seodenver.com/hierarchical-link-categories-wordpress/' rel='bookmark' title='Hierarchical Link Categories for WordPress'>Hierarchical Link Categories for WordPress</a></li>
<li><a href='http://www.seodenver.com/valuable-gov-links-fda-warning-letter/' rel='bookmark' title='Want some valuable .gov links? Get a FDA warning letter!'>Want some valuable .gov links? Get a FDA warning letter!</a></li>
<li><a href='http://www.seodenver.com/democratic-convention-08-denver/' rel='bookmark' title='Denver Democratic Convention Vendor List &amp; Link Exchange'>Denver Democratic Convention Vendor List &amp; Link Exchange</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<h2>Links are not a first-class citizens in WordPress</h2>
<p>In developing the a website for <a title="Professional Genealogy" href="http://www.melickprofessionalgenealogists.com/">professional genealogists</a>, I was tasked with creating link directory functionality in WordPress. I didn&#8217;t want to install some big plugins; I wanted to use the Links Manager that&#8217;s built in to every WP install out of the box. There were two problems, however:</p>
<ol>
<li>Link categories are not hierarchical, and;</li>
<li>There is no pagination in the <a href="http://codex.wordpress.org/Links_Manager">Links Manager</a>: all links are displayed on one page by default.</li>
</ol>
<p><span style="font-family: Georgia, 'Bitstream Charter', serif; line-height: 24px; font-size: 16px;"><strong>My client&#8217;s website will have over 20,000 links</strong>; having them all on one page was simply not an option. </span></p>
<p><span style="font-family: Georgia, 'Bitstream Charter', serif; line-height: 24px; font-size: 16px;"> </span>I didn&#8217;t want to create a new Post Type or Taxonomy; Links are already the right tool for the job. I moved forward creating the custom solution, and am sharing the results of that development here. The result of the project was a successful deployment of a crazy amount of links (see an example on their <a href="http://www.melickprofessionalgenealogists.com/regions/united-states/iowa/">Iowa genealogy resources</a> page).<span id="more-2213"></span></p>
<h3>Hierarchical link categories</h3>
<div id="attachment_2216" class="wp-caption alignright" style="width: 166px"><a href="http://www.seodenver.com/wp-content/uploads/2011/03/Screen-shot-2011-03-16-at-11.40.01-AM.jpg"><img class="size-medium wp-image-2216" title="Hierarchical Link Categories" src="http://www.seodenver.com/wp-content/uploads/2011/03/Screen-shot-2011-03-16-at-11.40.01-AM-156x300.jpg" alt="Hierarchical Link Categories" width="156" height="300" /></a><p class="wp-caption-text">Hierarchical Link Categories</p></div>
<p>To solve the hierarchical link category issue, <a href="http://wordpress.org/extend/plugins/hierarchical-link-categories/">I created a plugin</a> that defined the link taxonomy before WordPress, allowing link categories to be hierarchical. A few changes to the backend, and it worked properly.</p>
<h3>Paginated link pages</h3>
<p>For some reason, WordPress has treated links as an illegitimate child for years. They impose limits on the functionality (such as non-hierarchical categories) for no reason. A perfect example is that every other taxonomy (posts, pages, media, users, plugins, and even <em>themes</em>) has pagination functionality out of the box.</p>
<p>WordPress 3.1 completely revamped the link manager and most of the taxonomy functionality. This made implementing paginated links as simple as modifying one file. I hoped that I would be able to code this as a plugin, but <strong>achieving link manager pagination functionality without modifying core files was impossible</strong>. I went to work hacking the file responsible for the backend links manager display: <code>/wp-admin/includes/class-wp-links-list-table.php</code>.</p>
<div id="attachment_2215" class="wp-caption aligncenter" style="width: 335px"><img class="size-full wp-image-2215" title="Link Pagination Works!" src="http://www.seodenver.com/wp-content/uploads/2011/03/Screen-shot-2011-03-16-at-11.40.06-AM.jpg" alt="WordPress Link Pagination" width="325" height="29" /><p class="wp-caption-text">292 pages of links, with 800 more to come!</p></div>
<p>I ended up with a solution that works, but lacks some of the basic functionality that other taxonomies have: there is no box in the Screen Options tab that allows you to change how many links per page are displayed. There is, however, a filter (<code>edit_links_per_page</code>) that allows you to modify this number yourself.</p>
<p>It&#8217;s a huge improvement and makes managing large numbers of links possible. Before, the database load itself was ridiculous, let alone the MB&#8217;s of HTML that had to load. Now, managing large numbers of links is as painless as it should have been from the start.</p>
<h3>Download the modified file</h3>
<p>To install:</p>
<ol>
<li>Download and extract this file</li>
<li>Replace your <code>/wp-admin/includes/class-wp-links-list-table.php</code> file with this one</li>
</ol>
Note: There is a file embedded within this post, please visit this post to download the file.
<p>Please leave feedback and improvements, bugs, etc. below in the comments.</p>
<p>Related posts:<ol>
<li><a href='http://www.seodenver.com/hierarchical-link-categories-wordpress/' rel='bookmark' title='Hierarchical Link Categories for WordPress'>Hierarchical Link Categories for WordPress</a></li>
<li><a href='http://www.seodenver.com/valuable-gov-links-fda-warning-letter/' rel='bookmark' title='Want some valuable .gov links? Get a FDA warning letter!'>Want some valuable .gov links? Get a FDA warning letter!</a></li>
<li><a href='http://www.seodenver.com/democratic-convention-08-denver/' rel='bookmark' title='Denver Democratic Convention Vendor List &amp; Link Exchange'>Denver Democratic Convention Vendor List &amp; Link Exchange</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.seodenver.com/paginate-links-wordpress-link-manager/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Storing Data in WordPress Plugins &#8211; A Quick Rundown</title>
		<link>http://www.seodenver.com/storing-data-wordpress/</link>
		<comments>http://www.seodenver.com/storing-data-wordpress/#comments</comments>
		<pubDate>Tue, 23 Nov 2010 17:42:39 +0000</pubDate>
		<dc:creator>Zack Katz</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Options]]></category>
		<category><![CDATA[Plugin Development]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Transients]]></category>
		<category><![CDATA[WordPress Development]]></category>
		<category><![CDATA[WP Cache]]></category>

		<guid isPermaLink="false">http://www.seodenver.com/?p=1849</guid>
		<description><![CDATA[Coding better WordPress plugins As I&#8217;ve worked with WordPress plugins, I&#8217;ve learned new ways of working with WordPress. WordPress has tons of built-in functionality that is very useful and easy to use once discovered. I am by no means a &#8230; <a href="http://www.seodenver.com/storing-data-wordpress/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://www.seodenver.com/passing-parameters-php-javascripts-plugins-otto-onwordpress/' rel='bookmark' title='Passing parameters from PHP to Javascripts in plugins » Otto on WordPress'>Passing parameters from PHP to Javascripts in plugins » Otto on WordPress</a></li>
<li><a href='http://www.seodenver.com/auto-optimize-wordpress-database/' rel='bookmark' title='Auto-Optimize WordPress Database without a Plugin'>Auto-Optimize WordPress Database without a Plugin</a></li>
<li><a href='http://www.seodenver.com/how-to-tell-if-your-wordpress-widget-is-activated/' rel='bookmark' title='How to tell if your WordPress Plugin or Widget is Activated in WordPress'>How to tell if your WordPress Plugin or Widget is Activated in WordPress</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<img class="post_image aligncenter" src="http://www.seodenver.com/wp-content/uploads/2010/11/abbey-road.jpg" width="500" height="133" alt="Beatles love WordPress" /><h2>Coding better WordPress plugins</h2>
<p>As I&#8217;ve worked with <a href="http://www.seodenver.com/tag/wordpress-plugins/">WordPress plugins</a>, I&#8217;ve learned new ways of working with WordPress. WordPress has tons of built-in functionality that is very useful and easy to use once discovered.</p>
<p>I am by no means a great PHP coder. I am still learning <a href="http://php.net/manual/en/language.oop5.php">OOP</a> principles and how to write code better. In creating new WordPress plugins (<a href="http://wordpress.org/extend/plugins/profile/katzwebdesign">see a list of my plugins</a>), I have improved how I code: writing more efficient code using WordPress functionality rather than hacks.</p>
<p>One of the methods of coding that I have discovered (thanks to <a rel="follow" href="http://simianuprising.com/">Jeremy Clarke</a>) is using the WP Cache and Transient APIs to store plugin data. It&#8217;s made a big difference in the speed of all my plugins.</p>
<p>The following is a quick review of three different ways of storing data when you code plugins or work with WordPress. This is to the best of my knowledge, and <strong>I welcome feedback/improvements in the comments</strong>.<span id="more-1849"></span></p>
<h2>There are three core ways of storing WordPress plugin data:</h2>
<h3>1. Options</h3>
<p>This is how most plugins store data, and how I always stored data until I discovered the <a href="http://codex.wordpress.org/Function_Reference/WP_Cache">WP Cache API</a>. An option is permanently stored in the database, which was at times inconvenient. At times, I wanted to refresh the cached data every 12 hours. I hacked some code together to do that, not knowing about the other caching functions available (see below).</p>
<h4>Combine options for reduced database calls:</h4>
<p>When using options, many plugins save each setting as their own option. This makes for multiple database requests for even the most simple functionality. Instead, combine the settings into one option by making all of the plugin settings a single array.</p>
<p>Let&#8217;s say we have three settings for an Example plugin: <code>username</code>, <code>password</code>, <code>URL</code>. Instead of having three options (<code>example_username</code>, <code>example_password</code>, and <code>example_url</code>), we can combine them by setting the input <code>name</code> to <code>example[username]</code>, <code>example[password]</code> and <code>example[url]</code>. Now, when we <code>get_option('example')</code>, it is an array of the three settings. One <code>get_option()</code> call replaces three.</p>
<h4>Functions used:</h4>
<ul>
<li><code>get_option()</code></li>
<li><code>set_option()</code></li>
<li><code>update_option()</code></li>
</ul>
<h3>2. Transients</h3>
<p>Transients are my new best friend.</p>
<p>For the recent <a href="http://www.seodenver.com/lottery/">Lottery Results</a> plugins, it made sense to store lottery numbers results for a few hours, then fetch new data. <strong>What I didn&#8217;t want to do was to fetch new data every page load</strong>. For lottery results, I wanted new data every 6 hours. Enter the <a href="http://codex.wordpress.org/Transients_API">WP Transients API</a>. Transients are stored in the options database, but are used, accessed and updated differently.</p>
<p>Once I retrive the lottery data, I store it using Transients:</p>
<p><code>set_transient('lottery_results_'.$state_code, $results, 60*60*6);</code></p>
<p>When the lottery widget is displayed, I try to fetch the stored data using:</p>
<p><code>get_transient('lottery_results_'.$state_code);</code></p>
<p>If the transient data is not available, that means that it has expired &#8211; and <strong>only if the data expires do I need to re-generate it</strong>. This saves tons of load time, server load, etc. It&#8217;s wonderful, and all built in to WordPress. I&#8217;ve incorporated the same transient caching in most of my plugins, including the <a href="http://wordpress.org/extend/plugins/wunderground/">Wunderground weather plugin</a>. Caching the data speeds everything up considerably.</p>
<h4>Functions used:</h4>
<ul>
<li><code>set_transient()</code></li>
<li><code>get_transient()</code></li>
<li><code>delete_transient()</code></li>
</ul>
<h3>3. Cache</h3>
<blockquote><p>WP_Object_Cache is WordPress&#8217; class for caching data which may be computationally expensive to regenerate, such as the result of complex database queries. The object cache is defined in wp-includes/cache.php&#8230;.</p>
<p>The most common use for the object cache is caching the results of expensive SQL queries so they&#8217;re not performed multiple times within a page load. In the below example, imagine the $query variable is an expensive SQL query.<br />
<cite><a href="http://codex.wordpress.org/Function_Reference/WP_Cache">WP Cache page on Codex</a></cite></p></blockquote>
<p>If your code uses the same database query results over and over, and you perform the query new each time, you are wasting resources. By using the WP Cache functionality, you can make that request once, then store the results. When you need that dataset again, get the results using <code>wp_cache_get()</code>, and you&#8217;ll save many hits on the database or calling external files multiple times.</p>
<p>To find out what data is stored in the cache (you will be surprised!), add this to your functions.php file:</p>
<pre>add_action('wp_footer', 'show_cache_data_in_footer');
function show_cache_data_in_footer() {
	global $wp_object_cache;
	$wp_object_cache-&gt;stats();
}</pre>
<h4>Functions used:</h4>
<ul>
<li><code>wp_cache_add()</code></li>
<li><code>wp_cache_set()</code></li>
<li><code>wp_cache_get()</code></li>
<li><code>wp_cache_delete()</code></li>
<li><code>wp_cache_replace()</code></li>
<li><code>wp_cache_flush()</code></li>
</ul>
<p>I hope this helps people who are wanting to code WordPress plugins or are already coding them and want to do it better!</p>
<p>Related posts:<ol>
<li><a href='http://www.seodenver.com/passing-parameters-php-javascripts-plugins-otto-onwordpress/' rel='bookmark' title='Passing parameters from PHP to Javascripts in plugins » Otto on WordPress'>Passing parameters from PHP to Javascripts in plugins » Otto on WordPress</a></li>
<li><a href='http://www.seodenver.com/auto-optimize-wordpress-database/' rel='bookmark' title='Auto-Optimize WordPress Database without a Plugin'>Auto-Optimize WordPress Database without a Plugin</a></li>
<li><a href='http://www.seodenver.com/how-to-tell-if-your-wordpress-widget-is-activated/' rel='bookmark' title='How to tell if your WordPress Plugin or Widget is Activated in WordPress'>How to tell if your WordPress Plugin or Widget is Activated in WordPress</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.seodenver.com/storing-data-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Auto-Optimize WordPress Database without a Plugin</title>
		<link>http://www.seodenver.com/auto-optimize-wordpress-database/</link>
		<comments>http://www.seodenver.com/auto-optimize-wordpress-database/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 19:17:41 +0000</pubDate>
		<dc:creator>Zack Katz</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Functions.php]]></category>
		<category><![CDATA[load time]]></category>
		<category><![CDATA[Optimization]]></category>
		<category><![CDATA[Speed]]></category>
		<category><![CDATA[WordPress Development]]></category>
		<category><![CDATA[WordPress Functions]]></category>
		<category><![CDATA[WP-DBManager]]></category>

		<guid isPermaLink="false">http://www.seodenver.com/?p=1539</guid>
		<description><![CDATA[These horses are somehow not cool. Speeding up your blog is. I am working on a WordPress project that has a pretty heavy database, and I want to be able to auto-optimize the WordPress database. Even though they are integrating &#8230; <a href="http://www.seodenver.com/auto-optimize-wordpress-database/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://www.seodenver.com/how-to-tell-if-your-wordpress-widget-is-activated/' rel='bookmark' title='How to tell if your WordPress Plugin or Widget is Activated in WordPress'>How to tell if your WordPress Plugin or Widget is Activated in WordPress</a></li>
<li><a href='http://www.seodenver.com/get-images-wordpress-functions/' rel='bookmark' title='Get Adjacent Images &#8211; More WordPress Functions'>Get Adjacent Images &#8211; More WordPress Functions</a></li>
<li><a href='http://www.seodenver.com/mad-mimi/' rel='bookmark' title='Mad Mimi Plugin for WordPress'>Mad Mimi Plugin for WordPress</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<img class="post_image aligncenter" src="http://www.seodenver.com/wp-content/uploads/2010/03/1245541_11014135-e1268334876986.jpg" width="500" height="132" alt="Improve the speed of your blog, just like these running horses are faster because they bleached their hair." /><h3>These horses are somehow not cool. Speeding up your blog is.</h3>
<p>I am working on a WordPress project that has a pretty heavy database, and I want to be able to auto-optimize the WordPress database. Even though they are <a href="http://core.trac.wordpress.org/browser/trunk/wp-admin/maint/repair.php">integrating this functionality into WordPress 3.0</a>, I want it now, and without having to use a plugin (I have had some issues with <a href="http://wordpress.org/extend/plugins/wp-dbmanager/">WP-DBManager</a> configuring properly on a few sites).</p>
<p>If you add the following code to your functions.php file, it will automatically optimize your WordPress database every 6 hours, keeping it squeaky clean.<span id="more-1539"></span></p>
<h2>Add to your theme&#8217;s functions.php</h2>
<pre lang="php">function kws_optimize_tables() {
	$debug = false;

	// Check to see if the lastOptimized option has been set (it's just a timestamp)
	$lastOptimized = get_option('lastOptimized');

	// If it's been longer than 1 week since it was last optimized, do it up!
	if(!$lastOptimized || $lastOptimized &lt; strtotime("-1 week", time())) { 

		// Update the lastOptimized option to the current time
		update_option('lastOptimized', time());

		// Do some MySQLing to optimize each table in the WordPress DB
		$query = 'SHOW TABLES FROM '. DB_NAME;
		$result = mysql_query($query);
		if (!$result &amp;&amp; $debug) {
			print('Invalid query: ' . mysql_error());
		}
		$num_rows = mysql_num_rows($result);
		if ($num_rows){
			 while ($row = mysql_fetch_row($result)){
		         $query = 'OPTIMIZE TABLE '.$row[0];
				 $result = mysql_query($query);
				 if (!$result &amp;&amp; $debug) {
				    print('Invalid query: ' . mysql_error());
				}
			}
		}
	}
}
add_action('init', 'kws_optimize_tables');</pre>
<p>Just wanted to share some quick code. If you want to change the frequency of the optimization, change &#8220;1 week&#8221; to whatever <a href="http://php.net/manual/en/function.strtotime.php">PHP strtotime()</a> variable you want. Make sure to keep the minus sign in there though!</p>
<p>Related posts:<ol>
<li><a href='http://www.seodenver.com/how-to-tell-if-your-wordpress-widget-is-activated/' rel='bookmark' title='How to tell if your WordPress Plugin or Widget is Activated in WordPress'>How to tell if your WordPress Plugin or Widget is Activated in WordPress</a></li>
<li><a href='http://www.seodenver.com/get-images-wordpress-functions/' rel='bookmark' title='Get Adjacent Images &#8211; More WordPress Functions'>Get Adjacent Images &#8211; More WordPress Functions</a></li>
<li><a href='http://www.seodenver.com/mad-mimi/' rel='bookmark' title='Mad Mimi Plugin for WordPress'>Mad Mimi Plugin for WordPress</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.seodenver.com/auto-optimize-wordpress-database/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>How to Prevent Loading WP-DownloadManager&#8217;s CSS File</title>
		<link>http://www.seodenver.com/prevent-loading-wpdownloadmanagers-css-file/</link>
		<comments>http://www.seodenver.com/prevent-loading-wpdownloadmanagers-css-file/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 18:25:24 +0000</pubDate>
		<dc:creator>Zack Katz</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[QuickTip]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[load time]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[WordPress Plugins]]></category>
		<category><![CDATA[WP Plugins]]></category>
		<category><![CDATA[WP-DownloadManager]]></category>

		<guid isPermaLink="false">http://www.seodenver.com/?p=1183</guid>
		<description><![CDATA[If you want to disable the WordPress plugin WP-DownloadManager&#8216;s download-css.css file from being loaded, add the following code to your functions.php file: remove_action('wp_print_styles', 'downloads_stylesheets'); Alternatively, if you would just like to use your own stylesheet, you can add a file &#8230; <a href="http://www.seodenver.com/prevent-loading-wpdownloadmanagers-css-file/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://www.seodenver.com/prevent-google-background-image-fading-slowly/' rel='bookmark' title='How to prevent your Google background image from fading in slowly.'>How to prevent your Google background image from fading in slowly.</a></li>
<li><a href='http://www.seodenver.com/disable-gravity-forms-css-stylesheet/' rel='bookmark' title='5 Easy Ways to Disable the Gravity Forms CSS Stylesheet'>5 Easy Ways to Disable the Gravity Forms CSS Stylesheet</a></li>
<li><a href='http://www.seodenver.com/setting-far-futures-expires-in-asp-using-asp-as-css/' rel='bookmark' title='Setting Far Futures Expires in ASP, Using ASP as CSS'>Setting Far Futures Expires in ASP, Using ASP as CSS</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.seodenver.com/wp-content/uploads/2009/11/200984_8974-150x150.jpg" alt="Stop loading WP-Downloads CSS File" title="Stop loading WP-Downloads CSS File" width="150" height="150" class="alignright size-thumbnail wp-image-1187" />
<p>If you want to disable the WordPress plugin <a href="http://lesterchan.net/wordpress/readme/wp-downloadmanager.html">WP-DownloadManager</a>&#8216;s <code>download-css.css</code> file from being loaded, add the following code to your <code>functions.php</code> file:</p>
<pre>remove_action('wp_print_styles', 'downloads_stylesheets');</pre>
<p>Alternatively, if you would just like to use your own stylesheet, you can add a file named <code>download-css.css</code> to your theme&#8217;s directory, and the plugin will automatically load your stylesheet instead.</p>
<p>Related posts:<ol>
<li><a href='http://www.seodenver.com/prevent-google-background-image-fading-slowly/' rel='bookmark' title='How to prevent your Google background image from fading in slowly.'>How to prevent your Google background image from fading in slowly.</a></li>
<li><a href='http://www.seodenver.com/disable-gravity-forms-css-stylesheet/' rel='bookmark' title='5 Easy Ways to Disable the Gravity Forms CSS Stylesheet'>5 Easy Ways to Disable the Gravity Forms CSS Stylesheet</a></li>
<li><a href='http://www.seodenver.com/setting-far-futures-expires-in-asp-using-asp-as-css/' rel='bookmark' title='Setting Far Futures Expires in ASP, Using ASP as CSS'>Setting Far Futures Expires in ASP, Using ASP as CSS</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.seodenver.com/prevent-loading-wpdownloadmanagers-css-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add a Store Catalog XML Sitemap to the Shopp Plugin</title>
		<link>http://www.seodenver.com/add-store-sitemap-shopp-plugin/</link>
		<comments>http://www.seodenver.com/add-store-sitemap-shopp-plugin/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 21:19:28 +0000</pubDate>
		<dc:creator>Zack Katz</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Shopp]]></category>
		<category><![CDATA[Google Base]]></category>
		<category><![CDATA[Google Base Feed]]></category>
		<category><![CDATA[RSS]]></category>
		<category><![CDATA[RSS Feed]]></category>
		<category><![CDATA[Shopp Plugin]]></category>
		<category><![CDATA[Shopping Cart]]></category>
		<category><![CDATA[WordPress RSS Feed]]></category>
		<category><![CDATA[WordPress Shopping Cart]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.seodenver.com/?p=1089</guid>
		<description><![CDATA[The Shopp default RSS/XML/Google Base solution was not enough. I needed to have a Google Base feed that featured all the store products. For some reason, the recommended process wasn&#8217;t working for me. It was either showing only recent products, &#8230; <a href="http://www.seodenver.com/add-store-sitemap-shopp-plugin/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://www.seodenver.com/add-canonical-tags-shopp-plugin-seo/' rel='bookmark' title='Add Canonical Tags to Shopp Plugin for SEO'>Add Canonical Tags to Shopp Plugin for SEO</a></li>
<li><a href='http://www.seodenver.com/shopp-plugin-edit-product-link/' rel='bookmark' title='Edit Product Link for Shopp Plugin'>Edit Product Link for Shopp Plugin</a></li>
<li><a href='http://www.seodenver.com/custom-rss-feed-in-wordpress/' rel='bookmark' title='How to Create a Custom RSS Feed in WordPress in 12 Lines of Code'>How to Create a Custom RSS Feed in WordPress in 12 Lines of Code</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<h3>The Shopp default RSS/XML/Google Base solution was not enough.</h3>
<p><img class="alignright size-medium wp-image-1090" title="RSS Feed, BABY!" src="http://www.seodenver.com/wp-content/uploads/2009/10/1082770_60147230-300x180.jpg" alt="RSS Feed, BABY!" width="300" height="235" /></p>
<p>I needed to have a Google Base feed that featured all the store products. For some reason, the <a href="http://docs.shopplugin.net/Setting_Up_Google_Base">recommended process</a> wasn&#8217;t working for me. It was either showing only recent products, or it wasn&#8217;t working at all.  Here&#8217;s how I fixed it:<span id="more-1089"></span></p>
<h3>This code will show you the way to full indexing. Trust it. Feel it.</h3>
<p>Add the following code before <code>case "newproducts-rss":</code> (near line 1295) in Shopp.php:</p>
<pre>// This adds sitemap functionality for all products
case "catalog-rss":
	$CatalogProducts = new CatalogProducts(array('show' =&gt; 50000));
	header("Content-type: application/rss+xml; charset=utf-8");
	echo shopp_rss($CatalogProducts-&gt;rss());
	exit();
	break;
</pre>
<p>Once you add that, you will be able to see a RSS feed of your entire catalog by visiting <code><em>yoursite.com/your-shop-location</em>/index.php?shopp_lookup=catalog-rss</code></p>
<p>If the RSS feed is empty, try commenting out (add <code>//</code> before it) the following code near line 484 in <code>/core/model/Category.php</code>: <code>$item = apply_filters('shopp_rss_item',$entry,$product);</code></p>
<p>Hope this helps!</p>
<p>Related posts:<ol>
<li><a href='http://www.seodenver.com/add-canonical-tags-shopp-plugin-seo/' rel='bookmark' title='Add Canonical Tags to Shopp Plugin for SEO'>Add Canonical Tags to Shopp Plugin for SEO</a></li>
<li><a href='http://www.seodenver.com/shopp-plugin-edit-product-link/' rel='bookmark' title='Edit Product Link for Shopp Plugin'>Edit Product Link for Shopp Plugin</a></li>
<li><a href='http://www.seodenver.com/custom-rss-feed-in-wordpress/' rel='bookmark' title='How to Create a Custom RSS Feed in WordPress in 12 Lines of Code'>How to Create a Custom RSS Feed in WordPress in 12 Lines of Code</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.seodenver.com/add-store-sitemap-shopp-plugin/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Simple Taxonomies Formatting &#8212; Improve the Plugin&#8217;s Code Output</title>
		<link>http://www.seodenver.com/format-simple-taxonomies-plugin-improve-code-output/</link>
		<comments>http://www.seodenver.com/format-simple-taxonomies-plugin-improve-code-output/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 07:42:00 +0000</pubDate>
		<dc:creator>Zack Katz</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[custom taxonomies]]></category>
		<category><![CDATA[custom taxonomy]]></category>
		<category><![CDATA[Joost]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Simple Taxonomies]]></category>
		<category><![CDATA[Taxonomies]]></category>
		<category><![CDATA[WordPress Development]]></category>
		<category><![CDATA[WordPress Plugins]]></category>
		<category><![CDATA[Yoast]]></category>

		<guid isPermaLink="false">http://www.seodenver.com/?p=971</guid>
		<description><![CDATA[I&#8217;ve been using Joost de Valk&#8217;s Simple Taxonomies plugin for a couple of projects, and I&#8217;ve been very disappointed by the formatting of the terms output code. When configuring the plugin, you have the option of choosing &#8220;Add terms to &#8230; <a href="http://www.seodenver.com/format-simple-taxonomies-plugin-improve-code-output/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://www.seodenver.com/strip-extra-imagescaler-attribute-from-plugin-generated-code/' rel='bookmark' title='Strip Extra ImageScaler Attribute from Plugin-Generated Code'>Strip Extra ImageScaler Attribute from Plugin-Generated Code</a></li>
<li><a href='http://www.seodenver.com/simple-vertical-align-plugin-for-jquery/' rel='bookmark' title='Simple Vertical Align Plugin for jQuery'>Simple Vertical Align Plugin for jQuery</a></li>
<li><a href='http://www.seodenver.com/add-taxonomy-support-allinone-seo-pack/' rel='bookmark' title='Add Custom Taxonomy Title Tags Support to All-In-One SEO Pack'>Add Custom Taxonomy Title Tags Support to All-In-One SEO Pack</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.seodenver.com/wp-content/uploads/2009/08/simple-taxonomies.jpg" width="500" height="114" alt="Making the Simple Taxonomies WordPress Plugin Semantic" /></p>
<p>I&#8217;ve been using Joost de Valk&#8217;s <a href="http://yoast.com/wordpress/simple-taxonomies/">Simple Taxonomies plugin</a> for a couple of projects, and I&#8217;ve been very disappointed by the formatting of the terms output code.</p>
<p>When configuring the plugin, you have the option of choosing &#8220;Add terms to the end of posts&#8221; or &#8220;Add terms to the end of excerpts.&#8221;  If you do, you get a <code>&lt;div&gt;</code> and a couple of <code>span</code>s. Not very <a href="http://en.wikipedia.org/wiki/Semantic_Web">semantic</a>.  Also, the code uses an #id, instead of a .class, meaning that if you have more than one post on a page with taxonomies, it no longer validates.</p>
<h3>Simple Taxonomies uses terms, so let&#8217;s make a list of them!</h3>
<p>Here&#8217;s a way to reformat the code and <strong>prevent overwriting in future plugin updates</strong>. We&#8217;re going to strip the code and use a definition list instead (<code>&lt;dl&gt;</code>). Definition lists in <acronym title="Hypertext Markup Language">HTML</acronym> have a term and description; just as a custom taxonomies creates a taxonomy and its terms.<span id="more-971"></span></p>
<p>Add this code to your theme&#8217;s <code>functions.php</code> file:</p>
<pre name="code" class="php">
// Remove the default Simple Taxonomies Formatting
remove_filter(   'the_excerpt', 'yoast_simple_taxonomies_excerpt_filter', 10, 1 );
remove_filter(   'the_content', 'yoast_simple_taxonomies_content_filter', 10, 1 );

// Make your own filter
function custom_simple_taxonomies_filter( $content, $type ) {
   $opt  = get_option('yoast_simpletax');
   $output = '';
   foreach ( $opt['taxonomies'] as $taxonomy ) {
      $filter = false;
      if ( $type == 'content' &amp;&#038; $taxonomy['filter'] ) {
         $filter = true;
      } else if ( $type == 'excerpt' &amp;&#038; $taxonomy['filterexcerpt'] ) {
         $filter = true;
      }
      if ( $filter ) {
         // For each term, create a dd wrapper (Definition Description)
         $terms = get_the_term_list( $post-&gt;ID, $taxonomy['name'], $taxonomy['label'].':&lt;/dt&gt;&lt;dd&gt;', ',&lt;/dd&gt;&lt;dd&gt;', '&lt;/dd&gt;' );
         if ($terms)
            // For each taxonomy, create a dt wrapper (Definition Term)
            $output .= &quot;\t&quot;.'&lt;dt class=&quot;taxonomy-'.$taxonomy['name'].'&quot;&gt;'.$terms.&quot;\n&quot;;
      }
   }
   if ($output != '') {
      // Wrap the shebang in a dl (Definition List)
      $content .= '&lt;dl class=&quot;yoast-taxonomy&quot;&gt;'.&quot;\n&quot;.$output.&quot;\n&quot;.'&lt;/dl&gt;'.&quot;\n&quot;;
   }
   return $content;
}

// Recreate the functions
function custom_simple_taxonomies_content_filter( $content ) {
   return custom_simple_taxonomies_filter( $content, 'content' );
}
function custom_simple_taxonomies_excerpt_filter( $content ) {
   return custom_simple_taxonomies_filter( $content, 'excerpt' );
}
// Add the filters back on the content
add_filter(   'the_excerpt', 'custom_simple_taxonomies_excerpt_filter', 10, 1 );
add_filter(   'the_content', 'custom_simple_taxonomies_content_filter', 10, 1 );
</pre>
<p>So, just paste the code into your <code>functions.php</code> file, and then you just need to style the output so that it <em>looks</em> the same (or not), and you&#8217;re all set.</p>

<p>Related posts:<ol>
<li><a href='http://www.seodenver.com/strip-extra-imagescaler-attribute-from-plugin-generated-code/' rel='bookmark' title='Strip Extra ImageScaler Attribute from Plugin-Generated Code'>Strip Extra ImageScaler Attribute from Plugin-Generated Code</a></li>
<li><a href='http://www.seodenver.com/simple-vertical-align-plugin-for-jquery/' rel='bookmark' title='Simple Vertical Align Plugin for jQuery'>Simple Vertical Align Plugin for jQuery</a></li>
<li><a href='http://www.seodenver.com/add-taxonomy-support-allinone-seo-pack/' rel='bookmark' title='Add Custom Taxonomy Title Tags Support to All-In-One SEO Pack'>Add Custom Taxonomy Title Tags Support to All-In-One SEO Pack</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.seodenver.com/format-simple-taxonomies-plugin-improve-code-output/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Display a Random Testimonial or Post in WordPress</title>
		<link>http://www.seodenver.com/how-to-display-a-random-testimonial-or-post-in-wordpress/</link>
		<comments>http://www.seodenver.com/how-to-display-a-random-testimonial-or-post-in-wordpress/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 10:35:30 +0000</pubDate>
		<dc:creator>Zack Katz</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Categories]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Posts]]></category>
		<category><![CDATA[query_posts]]></category>
		<category><![CDATA[Random Post]]></category>
		<category><![CDATA[Testimonials]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Development]]></category>

		<guid isPermaLink="false">http://katzwebdesign.wordpress.com/?p=40</guid>
		<description><![CDATA[Set up a testimonials category &#8212; no need for a plugin. There are a couple of plugins designed specifically for testimonials, but I didn&#8217;t want to use them; they use their own databases, and don&#8217;t keep with WordPress&#8217; simplicity. If &#8230; <a href="http://www.seodenver.com/how-to-display-a-random-testimonial-or-post-in-wordpress/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://www.seodenver.com/how-to-tell-if-your-wordpress-widget-is-activated/' rel='bookmark' title='How to tell if your WordPress Plugin or Widget is Activated in WordPress'>How to tell if your WordPress Plugin or Widget is Activated in WordPress</a></li>
<li><a href='http://www.seodenver.com/excluded-categories/' rel='bookmark' title='Save Coding Time by Creating Special-Case Categories in WordPress'>Save Coding Time by Creating Special-Case Categories in WordPress</a></li>
<li><a href='http://www.seodenver.com/view-all-posts-in-wordpress-admin/' rel='bookmark' title='How to View All (or more) Posts at once in WordPress Administration'>How to View All (or more) Posts at once in WordPress Administration</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<h2>Set up a testimonials category &#8212; no need for a plugin.</h2>
<p>There are a <a href="http://wordpress.org/extend/plugins/wp-testimonials/" title="WP-Testimonials">couple</a> of <a href="http://wordpress.org/extend/plugins/advanced-random-post/" title="Advanced Random Post">plugins</a> designed specifically for testimonials, but I didn&#8217;t want to use them; they use their own databases, and don&#8217;t keep with WordPress&#8217; simplicity. If possible, the best way to work with WordPress is to use it&#8217;s built-in functionality.</p>
<p>I also wanted to have the testimonials as a category in <acronym title="WordPress">WP</acronym>, rather than as a separate plugin.  <strong>This code will work for any type of category, not just a testimonial.</strong></p>
<p>Here&#8217;s how to create a random post item in your sidebar: <span id="more-40"></span></p>
<ol>
<li>
<h3>Create a Testimonials Category</h3>
<p>I created a category for testimonials. In this example, the category ID is 3</p>
</li>
<li>
<h3>Create the Query</h3>
<p><code>query_posts('showposts=1&#038;cat=3&#038;orderby=rand');</code></p>
<p><strong>Let&#8217;s break down what is going on in the code above:</strong></p>
<ol>
<li>Request one result (<code>showposts=1</code>)</li>
<li>Define the category ID for testimonials (<code>cat=3</code>)</li>
<li>Randomize the result (<code>orderby=rand</code>)</li>
</ol>
</li>
<li>
<h3>Display the testimonial</h3>
<pre name="code" class="php">
&lt;li class=&quot;widget&quot;&gt;
&lt;h2&gt;Testimonials&lt;/h2&gt;

	&lt;?php
	if (have_posts()) : while (have_posts()) : the_post();
	?&gt;
&lt;h3&gt;&lt;?php the_title() ?&gt;&lt;/h3&gt;

		&lt;?php the_excerpt() ?&gt;
	&lt;?php endwhile; endif; ?&gt;
&lt;/li&gt;

&lt;?php wp_reset_query(); ?&gt;
</pre>
</li>
</ol>
<p>With the simple code above, you can add testimonials to your WordPress website as a basic category, and have a random testimonial displayed in your sidebar.</p>
<p>To take it one step further, you can create a Testimonials template page, and have it as a static page on your website by simply having <code>query_posts('cat=3)</code>.</p>
<h3>Use Advanced Category Excluder</h3>
<p>You can exclude the testimonials category from your sidebar category widget and many other places on the site without having to tear up your theme and add a lot of custom code.  Simply download and install the <a href="http://wordpress.org/extend/plugins/advanced-category-excluder/">Advanced Cagtegory Excluder (ACE) plugin</a> for WordPress.</p>
<p><strong>Note: I updated this post to be more relevant and simple.</strong> The original post was on 2/21/2008.</p>
<p>Related posts:<ol>
<li><a href='http://www.seodenver.com/how-to-tell-if-your-wordpress-widget-is-activated/' rel='bookmark' title='How to tell if your WordPress Plugin or Widget is Activated in WordPress'>How to tell if your WordPress Plugin or Widget is Activated in WordPress</a></li>
<li><a href='http://www.seodenver.com/excluded-categories/' rel='bookmark' title='Save Coding Time by Creating Special-Case Categories in WordPress'>Save Coding Time by Creating Special-Case Categories in WordPress</a></li>
<li><a href='http://www.seodenver.com/view-all-posts-in-wordpress-admin/' rel='bookmark' title='How to View All (or more) Posts at once in WordPress Administration'>How to View All (or more) Posts at once in WordPress Administration</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.seodenver.com/how-to-display-a-random-testimonial-or-post-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>Get Adjacent Images &#8211; More WordPress Functions</title>
		<link>http://www.seodenver.com/get-images-wordpress-functions/</link>
		<comments>http://www.seodenver.com/get-images-wordpress-functions/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 16:24:11 +0000</pubDate>
		<dc:creator>Zack Katz</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Functions]]></category>
		<category><![CDATA[Functions.php]]></category>
		<category><![CDATA[get_adjacent_image_link]]></category>
		<category><![CDATA[get_next_image_link]]></category>
		<category><![CDATA[get_previous_image_link]]></category>
		<category><![CDATA[WordPress Developer]]></category>
		<category><![CDATA[WordPress Development]]></category>
		<category><![CDATA[WordPress Functions]]></category>

		<guid isPermaLink="false">http://www.seodenver.com/?p=911</guid>
		<description><![CDATA[WordPress, just get the adjacent image links. I&#8217;ll tell you what to do with them! WordPress is normally great about providing functions that have a return and an echo version.  In WordPress, if a function has the prefix get_, then &#8230; <a href="http://www.seodenver.com/get-images-wordpress-functions/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://www.seodenver.com/nofollow-seo-for-wordpress/' rel='bookmark' title='Nofollow SEO for your WordPress Functions'>Nofollow SEO for your WordPress Functions</a></li>
<li><a href='http://www.seodenver.com/auto-optimize-wordpress-database/' rel='bookmark' title='Auto-Optimize WordPress Database without a Plugin'>Auto-Optimize WordPress Database without a Plugin</a></li>
<li><a href='http://www.seodenver.com/wordpress-digg-shortcode/' rel='bookmark' title='WordPress Digg Shortcode Function &#8211; As Seen on WordPress.com'>WordPress Digg Shortcode Function &#8211; As Seen on WordPress.com</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-912" title="Get the adjacent photo, man." src="http://www.seodenver.com/wp-content/uploads/2009/08/adjacent.jpg" alt="Get the adjacent photo, man." width="500" height="161" /></p>
<h2>WordPress, just get the adjacent image links. I&#8217;ll tell you what to do with them!</h2>
<p>WordPress is normally great about providing functions that have a <code>return</code> and an <code>echo</code> version.  In WordPress, if a function has the prefix <code>get_</code>, then it does not <code>echo</code> (print it into the content), but rather returns the result so that it can be saved as a variable, like so:  <code>$example = get_example();</code></p>
<p>There are some functions that only have echo capability, so I wanted to share my work-around with you all.</p>
<h4>Updated image_link functions</h4>
<ul>
<li><strong>adjacent_image_link()</strong> » get_adjacent_image_link()</li>
<li><strong>previous_image_link()</strong> » get_previous_image_link()</li>
<li><strong>next_image_link()</strong> » get_next_image_link()</li>
</ul>
<p><span id="more-911"></span>To add the functions, <strong>paste the following code in your theme&#8217;s functions.php file:</strong></p>
<pre>// These functions are copied directly from wp-includes/media.php
// and modified to return the result instead of echo it.
function get_adjacent_image_link($prev = true) {
	global $post;
	$post = get_post($post);
	$attachments = array_values(get_children( array('post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') ));
	foreach ( $attachments as $k => $attachment )
		if ( $attachment->ID == $post->ID )
			break;
	$k = $prev ? $k - 1 : $k + 1;
	if ( isset($attachments[$k]) )
		return wp_get_attachment_link($attachments[$k]->ID, 'thumbnail', true);
}
function get_previous_image_link() {
	return get_adjacent_image_link(true);
}
function get_next_image_link() {
	return get_adjacent_image_link(false);
}</pre>
<p>Now you can use these functions on your website.  Any questions?  <img src='http://www.seodenver.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Related posts:<ol>
<li><a href='http://www.seodenver.com/nofollow-seo-for-wordpress/' rel='bookmark' title='Nofollow SEO for your WordPress Functions'>Nofollow SEO for your WordPress Functions</a></li>
<li><a href='http://www.seodenver.com/auto-optimize-wordpress-database/' rel='bookmark' title='Auto-Optimize WordPress Database without a Plugin'>Auto-Optimize WordPress Database without a Plugin</a></li>
<li><a href='http://www.seodenver.com/wordpress-digg-shortcode/' rel='bookmark' title='WordPress Digg Shortcode Function &#8211; As Seen on WordPress.com'>WordPress Digg Shortcode Function &#8211; As Seen on WordPress.com</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.seodenver.com/get-images-wordpress-functions/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>WordPress Digg Shortcode Function &#8211; As Seen on WordPress.com</title>
		<link>http://www.seodenver.com/wordpress-digg-shortcode/</link>
		<comments>http://www.seodenver.com/wordpress-digg-shortcode/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 17:01:39 +0000</pubDate>
		<dc:creator>Zack Katz</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Digg]]></category>
		<category><![CDATA[Digg Shortcode]]></category>
		<category><![CDATA[Functions.php]]></category>
		<category><![CDATA[WordPress Shortcode]]></category>
		<category><![CDATA[WordPress.com]]></category>

		<guid isPermaLink="false">http://www.seodenver.com/?p=854</guid>
		<description><![CDATA[When moving from WordPress.com, my Digg shortcodes broke. I wanted a simple way to transition my Digg chicklets to a WordPress.org installation. I created a function that does nothing special, except for reproducing the Digg shortcode functionality on WordPress.com. All &#8230; <a href="http://www.seodenver.com/wordpress-digg-shortcode/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://www.seodenver.com/gravity-forms-shortcode/' rel='bookmark' title='Gravity Forms Shortcode Explained'>Gravity Forms Shortcode Explained</a></li>
<li><a href='http://www.seodenver.com/get-images-wordpress-functions/' rel='bookmark' title='Get Adjacent Images &#8211; More WordPress Functions'>Get Adjacent Images &#8211; More WordPress Functions</a></li>
<li><a href='http://www.seodenver.com/excluded-categories/' rel='bookmark' title='Save Coding Time by Creating Special-Case Categories in WordPress'>Save Coding Time by Creating Special-Case Categories in WordPress</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<h2>When moving from WordPress.com, my Digg shortcodes broke.</h2>
<h3>I wanted a simple way to transition my Digg chicklets to a WordPress.org installation.</h3>
Array
<p>I created a function that does nothing special, except for reproducing the Digg shortcode functionality on WordPress.com.  All you need to do is enter <code>&#91;digg=http://digg.com/path_to_story_on_digg&#93;</code>, and it will create a Digg This chicklet for you.  Here&#8217;s the code in action &rarr;</p>
<p><span id="more-854"></span></p>
<pre>function kwd_digg_shortcode($content = null) {
    $url = $content[0];
    if( substr($url, 0, 1) == '=') { $url = substr($url, 1); };
    $content = '
    &lt;div class=&quot;alignright&quot;&gt; &lt;!-- for layout only; you can modify --&gt;
    &lt;script type=&quot;text/javascript&quot;&gt; digg_url = &quot;'.$url.'&quot;;&lt;/script&gt;
    &lt;script src=&quot;http://digg.com/tools/diggthis.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
    &lt;/div&gt;
';
    return $content;
}
add_shortcode('digg', 'kwd_digg_shortcode');
</pre>
<h3>How to install this on your blog</h3>
<p>Simply copy the code above into your theme&#8217;s functions.php file. Any existing Digg shortcodes should automatically start working again, and you also will be able to use the functionality as you were doing on the WordPress.com site.</p>
<p>Related posts:<ol>
<li><a href='http://www.seodenver.com/gravity-forms-shortcode/' rel='bookmark' title='Gravity Forms Shortcode Explained'>Gravity Forms Shortcode Explained</a></li>
<li><a href='http://www.seodenver.com/get-images-wordpress-functions/' rel='bookmark' title='Get Adjacent Images &#8211; More WordPress Functions'>Get Adjacent Images &#8211; More WordPress Functions</a></li>
<li><a href='http://www.seodenver.com/excluded-categories/' rel='bookmark' title='Save Coding Time by Creating Special-Case Categories in WordPress'>Save Coding Time by Creating Special-Case Categories in WordPress</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.seodenver.com/wordpress-digg-shortcode/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mountain America Jerky Redesign Launched</title>
		<link>http://www.seodenver.com/great-jerky-and-cufon/</link>
		<comments>http://www.seodenver.com/great-jerky-and-cufon/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 19:45:35 +0000</pubDate>
		<dc:creator>Zack Katz</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Web Design Portfolio]]></category>
		<category><![CDATA[Beef Jerky]]></category>
		<category><![CDATA[Cufon]]></category>
		<category><![CDATA[Denver SEO]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[Jerky]]></category>
		<category><![CDATA[Mountain America Jerky]]></category>
		<category><![CDATA[Text Replacement]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Web Fonts]]></category>
		<category><![CDATA[Word Spacing]]></category>
		<category><![CDATA[YSlow]]></category>

		<guid isPermaLink="false">http://seodenver.com/?p=766</guid>
		<description><![CDATA[Mountain America Jerky Redesign I&#8217;m happy to announce that today the new Mountain America Jerky website launched. Check out the site and try some of their crazy-good Garlic Black Pepper Beef Jerky. One perk of working with a nice client &#8230; <a href="http://www.seodenver.com/great-jerky-and-cufon/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://www.seodenver.com/career-magiccom-launched/' rel='bookmark' title='Career-Magic.com Launched'>Career-Magic.com Launched</a></li>
<li><a href='http://www.seodenver.com/denver-roofing-company-website-launched/' rel='bookmark' title='Denver Roofing Company &#8211; Website Launched!'>Denver Roofing Company &#8211; Website Launched!</a></li>
<li><a href='http://www.seodenver.com/denver-seo-informative-website-launched-denverseoinfo/' rel='bookmark' title='Denver SEO informative website launched: DenverSEO.info'>Denver SEO informative website launched: DenverSEO.info</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<h2><a title="Great jerky" href="http://www.mountainamericajerky.com/">Mountain America Jerky</a> Redesign</h2>
<div id="attachment_768" class="wp-caption aligncenter" style="width: 500px"><a href="http://katzwebdesign.files.wordpress.com/2009/07/jerky-beef-jerky-venison-jerky-and-more-the-best-natural-jerky-20090710.jpg"><img class="size-medium wp-image-769" title="Mountain America Jerky Before Redesign" src="http://www.seodenver.com//home/katzwebd/seodenver.com/wp-content/uploads/HLIC/katzwebdesign.files.wordpress.com/2009/07/cb41933b6726f614cd55bbd06187a5f7.jpg" alt="Mountain America Jerky Before Redesign" width="225" height="300" /></a> <a href="http://katzwebdesign.files.wordpress.com/2009/07/mountain-america-jerky-all-natural-beef-jerky-fresh-from-colorado-20090710.jpg"><img class="size-medium wp-image-768" title="Mountain America Jerky After Redesign" src="http://www.seodenver.com//home/katzwebd/seodenver.com/wp-content/uploads/HLIC/katzwebdesign.files.wordpress.com/2009/07/32da868add15ba64edd45bdc405d1e39.jpg" alt="Mountain America Jerky - After Redesign" width="225" height="300" /></a><p class="wp-caption-text">Mountain America Jerky - Before and After Redesign</p></div>
<p style="clear:both;">I&#8217;m happy to announce that today the new Mountain America Jerky website launched. <a href="http://www.mountainamericajerky.com" rel="nofollow">Check out the site</a> and try some of their crazy-good <strong><a href="http://www.mountainamericajerky.com/beef-jerky.php#product-BEGP08">Garlic Black Pepper Beef Jerky</a></strong>. One perk of working with a nice client who sells beef jerky is getting samples of the product! Seriously, though, it&#8217;s the best jerky I&#8217;ve ever had.</p>
<p>I started working with Mountain America Jerky as a SEO. Jerky is a competitive field, and they wanted to improve their ranking. After working with Chuck on the website&#8217;s optimization, he told me he wanted to go big and rebrand the site. The result is a rustic, functional, beautiful website.<span id="more-766"></span></p>
<h2>Developing with Cufón</h2>
<h3>Making text look nice is now a joy.</h3>
<p>When creating a visually rich site, there is often a tradeoff between aesthetics and functionality. That is especially true when you&#8217;re trying to make sure the site is SEO-friendly.</p>
<p>When creating the design for the site, I wanted to keep the nice fonts I was using, and I had just heard of <a href="http://cufon.shoqolate.com/generate/">Cufón text replacement</a>, an alternative to using images or Flash for text. Little did I know that I would end up using Cufón for the entire site&#8217;s content&#8230;and that it would look great.</p>
<h3>Cufón is not without issues</h3>
<p>There were a few issues I encountered while developing the website:</p>
<ol>
<li>If there was white space around a tag or in between tags, Cufón creates additional <code>canvas</code> blocks that would completely screw up the layout.</li>
<li>No CSS <code>word-spacing</code> property support</li>
<li>JavaScript size of the font files</li>
</ol>
<h3>1. Removing white space for Cufón</h3>
<p>Instead of coding without any line breaks, or tabs, I used PHP gzip functionality to save the HTML as a variable, then strip out all the line breaks. That means by the time Cufón touches it, the white space is gone and the problem solved.</p>
<p><strong>Add the following code to the top of your site&#8217;s PHP files</strong> (may not work on your server, but something similar should. Taken from <a href="http://websitetips.com/articles/optimization/css/crunch/" rel="nofollow"> this WebsiteTips.com article</a>):</p>
<p><code>ob_start ("ob_gzhandler"); // Initialize ob_gzhandler to send and compress data<br />
ob_start("compress"); // Call the function 'compress'<br />
header("Content-type: text/html;charset: UTF-8");<br />
function compress($buffer) {<br />
/* remove comments */<br />
$buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer);<br />
/* remove tabs, spaces, new lines, etc. */<br />
$buffer = str_replace(array("\r\n", "\r", "\n", "\t"), '', $buffer);<br />
/* remove unnecessary spaces */<br />
$buffer = str_replace(array('   ', '  ','  '), ' ', $buffer);<br />
$buffer = str_replace('{ ', '{', $buffer);<br />
$buffer = str_replace(' }', '}', $buffer);<br />
$buffer = str_replace(';  ', '; ', $buffer);<br />
$buffer = str_replace(',  ', ', ', $buffer);<br />
$buffer = str_replace(' {', '{', $buffer);<br />
$buffer = str_replace('} ', '}', $buffer);<br />
$buffer = str_replace(':  ', ': ', $buffer);<br />
$buffer = str_replace('  ,', ' ,', $buffer);<br />
$buffer = str_replace(' ;', ';', $buffer);<br />
$buffer = str_replace('.  ', '. ', $buffer);<br />
return $buffer;<br />
}</code><br />
Once that&#8217;s added to your site, the output should be super-condensed (view the page source), and the Cufón additional layout issues should be fixed.</p>
<h3>2. Word Spacing for Cufón</h3>
<p>There are more technical ways to do what I did to solve this issue, but here&#8217;s what I did: I enclosed the spaces that were too large with<code> <span class="smallspace"> </span>,</code> and gave <code>.smallspace</code> a <code>font-size:.35em;</code>. You&#8217;ll want to play with the size a bit; the font I was using had spaces that were <em>way</em> too big.</p>
<p>So, instead of the headline code being <code>&lt;h1&gt;Beef Jerky&lt;/h1&gt;</code>, it became <code>&lt;h1&gt;Beef&lt;span class=&quot;smallspace&quot;&gt; &lt;/span&gt;Jerky&lt;/h1&gt;</code></p>
<p>. That made the word spacing much better for the longer headlines on the site.</p>
<h3>3. Reducing the size of the font files</h3>
<p>The fonts were the largest file in the whole site, but I really wanted to use them! So, what I did was:</p>
<ul>
<li>Combine the three fonts into one Javascript file</li>
<li>Put the code at the bottom of the page (which makes the content show up unstyled for a moment, but it saves people from slower connections from a long-ass wait). Load speed improved noticeably.</li>
<li>Used the great <a href="http://farhadi.ir/works/smartoptimizer" rel="nofollow">SmartOptimizer</a> to automatically implement many <a href="http://developer.yahoo.com/performance/rules.html">load speed best practices</a>, including caching, far-future expires, and more. Check out both <a href="http://farhadi.ir/works/smartoptimizer" rel="nofollow">SmartOptimizer</a> and <a href="http://developer.yahoo.com/yslow/" rel="nofollow">YSlow</a> for more information, it&#8217;s GREAT; you won&#8217;t regret it!</li>
</ul>
<p>So the home page went from 830Kb to 675Kb (still large, but much better), and after the first page load, a huge amount of the site&#8217;s resources are cached, resulting in <strong>load times of under 1 second</strong>.</p>
<h4>Summary</h4>
<p>Working with Cufón was great, and it is definitely on the top of my list for neat tools. It would have been SO easy just to replace the headlines, but having replaced almost all the site&#8217;s text, I can say that it&#8217;s possible, and not too hard.</p>
<p><strong>Any questions</strong> about Cufón, the process, or thoughts about the website?</p>
<p>Related posts:<ol>
<li><a href='http://www.seodenver.com/career-magiccom-launched/' rel='bookmark' title='Career-Magic.com Launched'>Career-Magic.com Launched</a></li>
<li><a href='http://www.seodenver.com/denver-roofing-company-website-launched/' rel='bookmark' title='Denver Roofing Company &#8211; Website Launched!'>Denver Roofing Company &#8211; Website Launched!</a></li>
<li><a href='http://www.seodenver.com/denver-seo-informative-website-launched-denverseoinfo/' rel='bookmark' title='Denver SEO informative website launched: DenverSEO.info'>Denver SEO informative website launched: DenverSEO.info</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.seodenver.com/great-jerky-and-cufon/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Object Caching 0/0 objects using disk: basic

Served from: www.seodenver.com @ 2012-02-08 18:00:37 -->
