<?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>Kool Kat Web Designs</title>
	<atom:link href="http://www.koolkatwebdesigns.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.koolkatwebdesigns.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Tue, 21 May 2013 00:32:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Creating a Child Theme</title>
		<link>http://www.koolkatwebdesigns.com/creating-a-child-theme/</link>
		<comments>http://www.koolkatwebdesigns.com/creating-a-child-theme/#comments</comments>
		<pubDate>Tue, 21 May 2013 00:32:24 +0000</pubDate>
		<dc:creator>koolkat</dc:creator>
				<category><![CDATA[Websites]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.koolkatwebdesigns.com/?p=1205</guid>
		<description><![CDATA[I recently worked on a small project designed to promote a book of Cartoon Elephants. The project had a small budget so we decided to purchase a theme. I selected http://themeforest.net/item/rythm-one-page-responsive-wordpress-theme/3672895 as its one-page responsive format was ideal for the site. However, its style was nothing like how a site devoted to a book of [...]]]></description>
				<content:encoded><![CDATA[<p>I recently worked on a small project designed to promote a book of Cartoon Elephants. The project had a small budget so we decided to purchase a theme. I selected <a href="http://themeforest.net/item/rythm-one-page-responsive-wordpress-theme/3672895" target="_blank">http://themeforest.net/item/rythm-one-page-responsive-wordpress-theme/3672895</a> as its one-page responsive format was ideal for the site. However, its style was nothing like how a site devoted to a book of Cartoon Elephants should look! The answer to this was to create a child theme.</p>
<p>While I did create a few custom functions and other overrides, most of the work was accomplished with CSS. I also used the Tekton Pro font via <a href="https://typekit.com/fonts" target="_blank">typekit</a>. The result is a fun and colorful <a href="http://cartoonelephantbook.com/" target="_blank">Cartoon Elephant Book</a> site. </p>
<p>The creation of the child theme points out some guidelines to consider when selecting a theme that you will later customize. First, pick a theme that has the basic functionality you need. In this case it was a responsive design with a single page approach. Next, make sure that you can create the child theme you want from the original parent theme. Since my project was fairly simple, my considerations included the ability to create the right style. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.koolkatwebdesigns.com/creating-a-child-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How WooCommerce Stores Product Variations</title>
		<link>http://www.koolkatwebdesigns.com/how-woocommerce-stores-product-variations/</link>
		<comments>http://www.koolkatwebdesigns.com/how-woocommerce-stores-product-variations/#comments</comments>
		<pubDate>Sat, 04 May 2013 01:17:27 +0000</pubDate>
		<dc:creator>koolkat</dc:creator>
				<category><![CDATA[Websites]]></category>
		<category><![CDATA[ecommerce]]></category>
		<category><![CDATA[WooCommerce]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.koolkatwebdesigns.com/?p=1195</guid>
		<description><![CDATA[WooCommerce makes use of the standard WordPress SQL tables for both products and product variations. In the posts table, products are stored with the post_type of &#8220;product&#8221; and each variation for the product has a post_type of &#8220;product_variation&#8221;. The product variation has a post_parent set to the ID of the product it is related to. [...]]]></description>
				<content:encoded><![CDATA[<p>WooCommerce makes use of the standard WordPress SQL tables for both products and product variations. In the posts table, products are stored with the post_type of &#8220;product&#8221; and each variation for the product has a post_type of &#8220;product_variation&#8221;. The product variation has a post_parent set to the ID of the product it is related to. So, a product with the ID of 123 that has 5 variations will have 5 entries in the posts table, each with a post_parent of 123 and a post_type of &#8220;product_variation&#8221;.</p>
<p>Details about the variations are stored in the postmeta table. Each item in the postmeta table that relates to a variation will have a post_id that points back to that variation. This includes things like attribute name, price, sale price, weight, etc.</p>
<p>The list of attributes that you entered are stored as serialized data for the meta_key &#8220;_product_attributes&#8221;. This item will have a post_id that points back to the product. In our example, it would contain 123. Default attributes are also stored as serialized data. The meta_key for default attributes is &#8220;_default_attributes&#8221; and it too contains the post_id for the product.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.koolkatwebdesigns.com/how-woocommerce-stores-product-variations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using jQuery datatables with WordPress and AJAX</title>
		<link>http://www.koolkatwebdesigns.com/using-jquery-datatables-with-wordpress-and-ajax/</link>
		<comments>http://www.koolkatwebdesigns.com/using-jquery-datatables-with-wordpress-and-ajax/#comments</comments>
		<pubDate>Wed, 01 May 2013 18:14:08 +0000</pubDate>
		<dc:creator>koolkat</dc:creator>
				<category><![CDATA[Websites]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Jquery Datatables]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.koolkatwebdesigns.com/?p=1171</guid>
		<description><![CDATA[I have been working on a project requiring the use of jQuery Datatables. This jQuery plugin creates a table layout of data that can be sorted, filtered and dynamically updated. It is capable of getting data via AJAX which makes it very usable in a WordPress site. I am using datatables as part of a [...]]]></description>
				<content:encoded><![CDATA[<p>I have been working on a project requiring the use of j<a href="http://www.datatables.net/" target="_blank">Query Datatables.</a> This jQuery plugin creates a table layout of data that can be sorted, filtered and dynamically updated. It is capable of getting data via AJAX which makes it very usable in a WordPress site. I am using datatables as part of a plugin. The actual UI is generated by a shortcode. So the first step in the process is to register and then enqueue the scripts and styles I will need:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//register the scripts for shortcodes</span>
<span style="color: #000000; font-weight: bold;">function</span> register_script_for_shortcodes<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
wp_register_script<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'datatables'</span><span style="color: #339933;">,</span> plugins_url<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/js/jquery.dataTables.min.js'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>  <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'jquery'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
wp_register_script<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'datatablesreload'</span><span style="color: #339933;">,</span> plugins_url<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/js/jquery.datatables.reload.js'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>  <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'jquery'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
wp_register_script<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'rotarydatatables'</span><span style="color: #339933;">,</span> plugins_url<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/js/rotary.datatables.js'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>  <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'jquery'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
wp_register_style<span style="color: #009900;">&#40;</span>
<span style="color: #0000ff;">'rotary-datatables'</span><span style="color: #339933;">,</span>plugins_url<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/css/rotarydatatables.css'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color:#800080;">0.1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">//the scripts included here are need for the shortcodes</span>
<span style="color: #000000; font-weight: bold;">function</span> enqueue_scripts_for_shortcodes<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
wp_enqueue_style<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'rotary-datatables'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
wp_enqueue_script<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'datatables'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'datatablesreload'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rotarydatatables'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'jquery-ui-dialog'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
wp_localize_script<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'rotarydatatables'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rotarydatatables'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ajaxURL'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ajaxURL'</span> <span style="color: #339933;">=&gt;</span> admin_url<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'admin-ajax.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'tableNonce'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> wp_create_nonce<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'rotary-table-nonce'</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Notice how the code calls wp_localize_script to build variables that we can use with datatables so it knows where to make the AJAX call for its data source. The code snippet for this is:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;">rotaryTable <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'#rotarymembers'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>dataTable<span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #0000ff;">'bProcessing'</span><span style="color: #339933;">:</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>
				<span style="color: #0000ff;">'bServerSide'</span><span style="color: #339933;">:</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span>
				<span style="color: #0000ff;">'sAjaxSource'</span><span style="color: #339933;">:</span> rotarydatatables<span style="color: #339933;">.</span>ajaxURL<span style="color: #339933;">+</span><span style="color: #0000ff;">'?action=rotarymembers'</span></pre></td></tr></table></div>

<p>And remember, you will need to tell WordPress about your AJAX calls:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;">add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp_ajax_nopriv_rotarymembers'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rotary_get_members'</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp_ajax_rotarymembers'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rotary_get_members'</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>So, what do we do in the rotary_get_members function?<br />
First, we need to provide the data in a format that is expected by datatables. This includes the columns we will have and an array of data fields. The aaData array will have rows of data that appear in the table.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        	<span style="color: #0000ff;">'sColumns'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Name, Classification, Cell/Home Phone, Business Phone, Email'</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'sEcho'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'sEcho'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'iTotalRecords'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$rotaryclubmembers</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">MEMBER</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'iTotalDisplayRecords'</span> <span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'aaData'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Each row of data is placed in the $output variable as follows:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$output</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'aaData'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>And we call json_encode on the $output variable to feed it back to datatables.</p>
<p>The resulting UI looks like this:</p>
<p><a href="http://www.koolkatwebdesigns.com/wp-content/uploads/2013/05/members.jpg"><img src="http://www.koolkatwebdesigns.com/wp-content/uploads/2013/05/members-300x233.jpg" alt="JQuery Datatables UI" width="300" height="233" class="alignnone size-medium wp-image-1181" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.koolkatwebdesigns.com/using-jquery-datatables-with-wordpress-and-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GitHub</title>
		<link>http://www.koolkatwebdesigns.com/github/</link>
		<comments>http://www.koolkatwebdesigns.com/github/#comments</comments>
		<pubDate>Wed, 06 Mar 2013 20:36:24 +0000</pubDate>
		<dc:creator>koolkat</dc:creator>
				<category><![CDATA[Websites]]></category>

		<guid isPermaLink="false">http://www.koolkatwebdesigns.com/?p=1167</guid>
		<description><![CDATA[I finally started using GitHub and created my first pull request. My prior experience with version control was with SVN so I was a bit nervous &#8211; wondering if I would break the original. Of course, nothing broke  and now I am  a fan. I also tried out the free mac app which helped with [...]]]></description>
				<content:encoded><![CDATA[<p>I finally started using GitHub and created my first pull request. My prior experience with version control was with SVN so I was a bit nervous &#8211; wondering if I would break the original. Of course, nothing broke  and now I am  a fan. I also tried out the <a href="http://mac.github.com/" target="_blank">free mac app </a>which helped with learning curve as I did not need to think about the command line interface.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.koolkatwebdesigns.com/github/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rotary WordPress Theme</title>
		<link>http://www.koolkatwebdesigns.com/rotary-wordpress-theme/</link>
		<comments>http://www.koolkatwebdesigns.com/rotary-wordpress-theme/#comments</comments>
		<pubDate>Sun, 03 Feb 2013 21:56:10 +0000</pubDate>
		<dc:creator>koolkat</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[WordPress Projects]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[Rotary]]></category>
		<category><![CDATA[Wordpress themes]]></category>

		<guid isPermaLink="false">http://www.koolkatwebdesigns.com/?p=1117</guid>
		<description><![CDATA[<strong>Target Clients:</strong> Rotary Clubs

<strong>Project Description:</strong>  The Rotary WordPress theme, designed by <a href="http://www.carolinatorres.com/" target="_blank">Carolina Torres</a>, is a custom WordPress theme aimed at Rotary Clubs. 

<strong>Demo Website:</strong> <a href="http://www.rotarytheme.koolkattest.com/" target="_blank">http://www.rotarytheme.koolkattest.com/</a>]]></description>
				<content:encoded><![CDATA[<p><strong>Target Clients:</strong> Rotary Clubs</p>
<p><strong>Project Description:</strong>  The Rotary WordPress theme, designed by <a href="http://www.carolinatorres.com/" target="_blank">Carolina Torres</a>, is a custom WordPress theme aimed at Rotary Clubs. The theme includes a home page sidebar, custom widgets and makes ample use of the WordPress theme customizer which allows clubs to add their own club data. Future plans include a Rotary membership plugin.</p>
<p><strong>Demo Website:</strong> <a href="http://www.rotarytheme.koolkattest.com/" target="_blank">http://www.rotarytheme.koolkattest.com/</a></p>
<p>The theme Rotary theme project was started by the Bellevue Breakfast Rotary Club (<a target="_blank" href="http://bbrc.net/">BBRC</a>). For more information on using this theme, please contact the <a target="_blank" href="http://bbrc.net/">BBRC</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.koolkatwebdesigns.com/rotary-wordpress-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Going Repsonsive</title>
		<link>http://www.koolkatwebdesigns.com/going-repsonsive/</link>
		<comments>http://www.koolkatwebdesigns.com/going-repsonsive/#comments</comments>
		<pubDate>Mon, 14 Jan 2013 22:40:10 +0000</pubDate>
		<dc:creator>koolkat</dc:creator>
				<category><![CDATA[Mobile Websites]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Responsive design]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.koolkatwebdesigns.com/?p=1107</guid>
		<description><![CDATA[I finally got around to updating my own website to have a responsive layout for phones and tablets. In order to achieve the desired result, I spent considerable time trying to retrofit my site to the responsive world. I very quickly learned why many experts say to design for mobile first. I simplified the work [...]]]></description>
				<content:encoded><![CDATA[<p>I finally got around to updating my own website to have a responsive layout for phones and tablets. In order to achieve the desired result, I spent considerable time trying to retrofit my site to the responsive world. I very quickly learned why many experts say to design for mobile first. I simplified the work by setting 2 media query breakpoints:<br />
<code>
<ul>
<li>@media only screen and (min-width: 768px) and (max-width: 959px)</li>
<li>@media only screen and (max-width: 480px), only screen and (max-width: 767px)</li>
</ul>
<p></code></p>
<p>In addition, I replaced the outdated jQuery innerfade plugin with <a href="http://www.woothemes.com/flexslider/" target="_blank">Flexslider</a>. This allow my slideshow to be sized for smaller screens. </p>
<p>I am now testing out the site using <a href="http://www.browserstack.com/" target="_blank">Browser Stack</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.koolkatwebdesigns.com/going-repsonsive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Sassy with WordPress Part 2 &#8211; Sprites</title>
		<link>http://www.koolkatwebdesigns.com/getting-sassy-with-wordpress-part-2-sprites/</link>
		<comments>http://www.koolkatwebdesigns.com/getting-sassy-with-wordpress-part-2-sprites/#comments</comments>
		<pubDate>Wed, 07 Nov 2012 20:04:19 +0000</pubDate>
		<dc:creator>koolkat</dc:creator>
				<category><![CDATA[Compass]]></category>
		<category><![CDATA[SCSS]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.koolkatwebdesigns.com/?p=1055</guid>
		<description><![CDATA[In Getting Sassy with WordPress Part 1, we discussed how to manage using Compass and SASS for your WordPress project. Now we can take our use of Compass one step further and start using image sprites. Image sprites have been used in CSS for quite some time, lending efficiency to both our stylesheets and downloads. [...]]]></description>
				<content:encoded><![CDATA[<p>In <a href="http://www.koolkatwebdesigns.com/getting-sassy-with-wordpress/" title="Getting Sassy with WordPress">Getting Sassy with WordPress Part 1</a>, we discussed how to manage using Compass and SASS for your WordPress project. Now we can take our use of Compass one step further and start using image sprites.</p>
<p>Image sprites have been used in CSS for quite some time, lending efficiency to both our stylesheets and downloads. With Compass, you can take the labor out of creating images and let Compass do the work for you. Compass can take .png files and create a sprite file. You then use a mixin to reference which image you want to use. </p>
<p>In part 1, we discussed how to use the Compass generated stylsheets in WordPress. Images should also reside in your project directory. So, if your project is directory is <em>&#8220;rotary-sass&#8221;</em>, this is where your images directory should be located. Note that this is different from the typical WordPress implementation where the image directory appears immediately under the theme or stylesheet directory.</p>
<p>Once your image directory is in the correct location for Compass, create sub-directory for your .png images that will be &#8220;sprited&#8221; under the images directory. I called my directory, <strong>backgrounds</strong>. Here is what this directory structure looks like in my Compass project:<br />
<a href="http://www.koolkatwebdesigns.com/wp-content/uploads/2012/11/compass-image-files.png"><img src="http://www.koolkatwebdesigns.com/wp-content/uploads/2012/11/compass-image-files-300x148.png" alt="Compass Image Files" title="Compass Image Files" width="300" height="148" class="alignnone size-medium wp-image-1058" /></a></p>
<p>The next step is to copy all of your .png images to be sprited int to the backgrounds directory. In your SASS file, include the following:<br />
<code>@import "backgrounds/*.png";</code><br />
<em>Note: I put this import statement in my _bass.scss file.</em></p>
<p>Then, wherever you need one the background images, use the following mixin&#8230;<br />
<code>@include backgrounds-sprite("filename");</code><br />
where backgrounds is your directory name and filename is the actual name of your <strong>original</strong> .png file without the extension. Compass will create a new sprite file in your images directory. It will have a name similar to:<br />
<code>backgrounds-sfc45308739.png</code><br />
where backgrounds will be replaced by whatever name you used for your sprite directory. This file is referenced in your generated CSS file so be sure to upload it to your server along with the CSS file. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.koolkatwebdesigns.com/getting-sassy-with-wordpress-part-2-sprites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Sassy with WordPress Part 1</title>
		<link>http://www.koolkatwebdesigns.com/getting-sassy-with-wordpress/</link>
		<comments>http://www.koolkatwebdesigns.com/getting-sassy-with-wordpress/#comments</comments>
		<pubDate>Mon, 22 Oct 2012 18:25:19 +0000</pubDate>
		<dc:creator>koolkat</dc:creator>
				<category><![CDATA[Compass]]></category>
		<category><![CDATA[SCSS]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[SASS]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.koolkatwebdesigns.com/?p=1021</guid>
		<description><![CDATA[For a while now, there has been a lot of talk about CSS pre-processors such as LESS and SASS.  As the the details of how such pre-processors work as well as their benefits and drawback have been discussed many places, I will not discuss that here. Instead, I will focus on how I use SASS [...]]]></description>
				<content:encoded><![CDATA[<p>For a while now, there has been a lot of talk about CSS pre-processors such as <a href="http://lesscss.org/" target="_blank">LESS</a> and <a href="http://sass-lang.com/" target="_blank">SASS</a>.  As the the details of how such pre-processors work as well as their benefits and drawback have been discussed many places, I will not discuss that here. Instead, I will focus on how I use SASS on my WordPress sites.</p>
<p>First, I always want to use the <a href="http://compass-style.org/" target="_blank">Compass</a> CSS Authoring Framework. This framework comes with its own <em>mixins</em>, making CSS3 easy &#8211; you never have to worry about vendor prefixes! And, it supports all of the standard SASS rules, variables and selector inheritance. To make life even easier, there is an <a href="http://compass.handlino.com/" target="_blank">app</a> that even lets you avoid the command line.</p>
<h2>Using the Compass App</h2>
<p>I am going to step through the process of using the Compass app on a mac. After successfully installing compass.app, you will get a new icon in the top toolbar area.<br />
<a href="http://www.koolkatwebdesigns.com/wp-content/uploads/2012/10/compass-icon.png"><img class="alignnone size-full wp-image-1028" title="compass icon" src="http://www.koolkatwebdesigns.com/wp-content/uploads/2012/10/compass-icon.png" alt="compass icon" width="208" height="71" /></a></p>
<ol>
<li>Click the icon and select &#8220;Create compass project&#8221; and then &#8220;compass&#8221; and finally &#8220;project&#8221;</li>
<li>You will then see a finder window where you can select the location for your sass and css files.  I usually place my compass created project in the directory for my theme.</li>
<li>Let&#8217;s say you called your directory &#8220;rotary-sass&#8221;,  which for me resides in the directory &#8220;wp-content/themes/rotary&#8221;, you will end up with a file structure like this in your theme directory:</li>
<p><a href="http://www.koolkatwebdesigns.com/wp-content/uploads/2012/10/compass-files.png"><img class="alignnone size-medium wp-image-1035" title="compass files" src="http://www.koolkatwebdesigns.com/wp-content/uploads/2012/10/compass-files-300x202.png" alt="compass files" width="300" height="202" /></a></p>
<li>Now we can set some options. Click the compass icon again (which should now have turned orange, indicating an active project) and then click &#8220;Change Options&#8221;. My personal preference during development is for expanded CSS output, no line comments but <strong>debug checked</strong>. The reason for checking debug is that it will enable us to use the Firefox extension, FireSass. FireSass allows Firebug to display the original SASS filename and line numbers. Otherwise, you would just see the generated CSS line numbers making troubleshooting much more difficult. You can change the options once your project is finished so you can deliver compress CSS without the debug info.</li>
<li>Now that your project is set, all your changes to the SASS files will automatically change your CSS.</li>
<li>Next we need to tell WordPress where our new stylesheets reside.  The necessary code will both display the correct CSS rule for your project and return the correct directory and/or file for WordPress API calls such as <a title="Function Reference/get stylesheet uri" href="http://codex.wordpress.org/Function_Reference/get_stylesheet_uri" target="_blank">get_stylesheet_uri()</a>.  You can add the following code to your <em>functions.php</em> file or a file included in your <em>functions.php</em>:<br />
<code>/**<br />
 * overwrite default theme stylesheet uri<br />
 * filter stylesheet_uri<br />
 * @see get_stylesheet_uri()<br />
 */<br />
 add_filter('stylesheet_uri','rotary_stylesheet_uri',10,2);<br />
function rotary_stylesheet_uri($stylesheet_uri, $stylesheet_dir_uri){</p>
<p>    return $stylesheet_dir_uri.'/rotary-sass/stylesheets/style.css';<br />
}</code>
</li>
<li>Finally, make sure that you have both FireBug and FireSass installed as add-in in your Firefox browser. If all is working correctly, your CSS debug info should show the location of your code in the SASS files. Notice that any included files from Compass also show up.</li>
<p><a href="http://www.koolkatwebdesigns.com/wp-content/uploads/2012/10/firesass.png"><img src="http://www.koolkatwebdesigns.com/wp-content/uploads/2012/10/firesass-300x136.png" alt="firesass" title="firesass" width="300" height="136" class="alignnone size-medium wp-image-1047" /></a>
</ol>
<p>Read <a href="http://www.koolkatwebdesigns.com/getting-sassy-with-wordpress-part-2-sprites/" title="Getting Sassy with WordPress Part 2 – Sprites">Getting Sassy with WordPress Part 2 &#8211; Sprites</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.koolkatwebdesigns.com/getting-sassy-with-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Helping the Client with Advanced Custom Fields</title>
		<link>http://www.koolkatwebdesigns.com/helping-the-client-with-advanced-custom-fields/</link>
		<comments>http://www.koolkatwebdesigns.com/helping-the-client-with-advanced-custom-fields/#comments</comments>
		<pubDate>Tue, 25 Sep 2012 20:01:07 +0000</pubDate>
		<dc:creator>koolkat</dc:creator>
				<category><![CDATA[Websites]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Advanced Custom Fields plugin]]></category>
		<category><![CDATA[websites]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.koolkatwebdesigns.com/?p=1011</guid>
		<description><![CDATA[The Patricia Rovzar Gallery uses a custom WordPress theme which allows the gallery to maintain its current artists and exhibits.  The gallery updates its featured artists on a monthly basis. While the site handled the image updates easily, the gallery was struggling with correctly formatting the text on the home page. The situation is complicated by [...]]]></description>
				<content:encoded><![CDATA[<p>The <a href="http://www.rovzargallery.com/" target="_blank">Patricia Rovzar Gallery</a> uses a custom WordPress theme which allows the gallery to maintain its current artists and exhibits.  The gallery updates its featured artists on a monthly basis. While the site handled the image updates easily, the gallery was struggling with correctly formatting the text on the home page. The situation is complicated by the fact that there may be one or two featured artists each month in addition to the need to change the focus depending on which artist is featured.  The initial attempt used <code>&lt;li&gt;</code> tags with classes from the style drop down. The tags often got overwritten by the visual editor and the client found the implementation cumbersome. To remedy this situation, we installed the <a href="http://www.advancedcustomfields.com/" target="_blank">Advanced Custom Fields</a> plugin. This plugin allowed us to separate out artists, exhibit dates and other information into separate fields which are easy for the gallery to maintain. Plus, the API provided by Advanced Custom Fields, gives us the ability to see how many artists there are for the current exhibit. This allows us to set CSS classes to control the format so the gallery owner does not need to worry about displaying the artists&#8217; information.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.koolkatwebdesigns.com/helping-the-client-with-advanced-custom-fields/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile Sites on the iPad</title>
		<link>http://www.koolkatwebdesigns.com/mobile-sites-on-the-ipad/</link>
		<comments>http://www.koolkatwebdesigns.com/mobile-sites-on-the-ipad/#comments</comments>
		<pubDate>Wed, 05 Sep 2012 16:34:36 +0000</pubDate>
		<dc:creator>koolkat</dc:creator>
				<category><![CDATA[Mobile Websites]]></category>
		<category><![CDATA[Websites]]></category>

		<guid isPermaLink="false">http://www.koolkatwebdesigns.com/?p=1008</guid>
		<description><![CDATA[I have been extremely annoyed lately by the proliferation of &#8220;m dot&#8221; (mobile) sites that show up by default on my iPad. They are often more limited than the full site and more difficult to navigate. There is no reason to show a mobile site on an iPad! I am not talking about a responsive [...]]]></description>
				<content:encoded><![CDATA[<p>I have been extremely annoyed lately by the proliferation of &#8220;m dot&#8221; (mobile) sites that show up by default on my iPad. They are often more limited than the full site and more difficult to navigate. There is no reason to show a mobile site on an iPad! I am not talking about a responsive design that rearranges content to accommodate the iPad width but a simplified version of the desktop site that is more appropriate to a mobile phone. While most of the sites do let you navigate to the full site, its is an extra step or two.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.koolkatwebdesigns.com/mobile-sites-on-the-ipad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
