<?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>Jaymin Patel &#187; KAPISH</title>
	<atom:link href="http://www.jayminkapish.com/category/kapish/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jayminkapish.com</link>
	<description>Wordpress Developer, New York</description>
	<lastBuildDate>Wed, 09 Nov 2011 15:33:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-alpha-19719</generator>
		<item>
		<title>New WordPress Theme &#8211; Optimized and SEO Friendly</title>
		<link>http://www.jayminkapish.com/2010/08/20/new-wordpress-theme-optimized-and-seo-friendly/</link>
		<comments>http://www.jayminkapish.com/2010/08/20/new-wordpress-theme-optimized-and-seo-friendly/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 14:01:35 +0000</pubDate>
		<dc:creator>Jaymin Patel</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[KAPISH]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Yahoo!]]></category>
		<category><![CDATA[Apache mod_expire]]></category>
		<category><![CDATA[SlideDeck]]></category>
		<category><![CDATA[Wordpress Optimized and SEO Friendly Theme]]></category>
		<category><![CDATA[WPZoom]]></category>

		<guid isPermaLink="false">http://www.jayminkapish.com/?p=272</guid>
		<description><![CDATA[The New Wordpress Theme which is optimized and SEO friendly. Google Page Speed ranks it at 94/100.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve subscribed to many Theme Blogs&#8217; RSS Feeds. They publish a few posts every week featuring WordPress Themes free as well as paid. And every time I take a look at new designs, I want something like that on my blog too!. I was used to design this blog theme every month and was not satisfied until now.</p>
<div class="inline-block right"><div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=187682461287759&amp;xfbml=1"></script><fb:like href="http://www.jayminkapish.com/2010/09/30/wordpress-instant-search-plugin/" send="false" layout="box_count" width="50" show_faces="false" font=""></fb:like>
<!-- Place this tag in your head or just before your close body tag -->
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<!-- Place this tag where you want the +1 button to render -->
<g:plusone size="tall"></g:plusone>
<a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-via="jayminkapish">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>
<p>Before I start designing this blog, I started taking notes from different blog themes. Mostly all themes have two and three columns layout which is very very common. My very first note was &#8220;I do not want two/three columns theme&#8221;. So I started designing HTML site with <a title="Thanks to SlideDeck for Slider" href="http://www.slidedeck.com/?ref=www.jayminkapish.com">SlideDeck</a> and <a href="http://code.google.com/webfonts" title="Google Fonts">Google Fonts API</a>. I started with index.html, single.html, 404.html, archive.html and search.html. I designed my logo which is also very simple and optimized for web.</p>
<p>When I had all HTML files ready, I started working on SEO. Remember!! Page Titles are so important? </p>
<p>I installed Google Page Speed and YSlow!. I mostly profile my html pages on Google Page Speed. </p>
<p>Google Page Speed highly recommends,</p>
<ol>
<li>One HTTP request for CSS</li>
<li>One HTTP request for JS</li>
<li>No whitespaces/empty lines in HTML</li>
<li>Compressed CSS and JS</li>
<li>Add Expiration Headers for JS and CSS</li>
</ol>
<p>I am using SlideDeck Slider so I had SlideDeck CSS and my theme CSS. How could you make one HTTP request for two different files? I could think of two options:</p>
<ol>
<li>Copy two files into one file and compress</li>
<li>Follow wp-admin/load-styles.php which reads so many files and compress them</li>
</ol>
<p>I chose second option because if I upgrade SlideDeck, I will have to do exercise again. With the second option, I can just drop the file at the correct location and I&#8217;m done. I did same thing with JS files too which reads jQuery, Google Analytics and some JS code that I wrote to support this theme.</p>
<p>I also added mod_expire lines in my .htaccess file that tells browsers to load resources (CSS/JS/Graphics from cache if not expired). Google recommends expiration should be at least 1 week.</p>
<p><code><br />
#Expiration<br />
&lt;ifmodule mod_expires.c&gt;<br />
ExpiresActive On<br />
ExpiresByType image/gif "access plus 1 week"<br />
ExpiresByType image/jpg "access plus 1 week"<br />
ExpiresByType image/png "access plus 1 week"<br />
ExpiresByType application/x-javascript "access plus 1 week"<br />
ExpiresByType text/css "access plus 1 week"<br />
ExpiresByType image/x-icon "access plus 1 week"<br />
&lt;/IfModule&gt;<br />
#End Expiration<br />
</code></p>
<p>I removed all white spaces and line breaks from my Theme files (Not sure how much that makes difference but will definitely reduce the size of the document). I also compressed JS/CSS using TextMate and YUI Compressor Bundle. I added alt text, height and width to all images I am using currently.</p>
<p>Compressing JS/CSS and one HTTP request for JS/CSS was helping a lot. After installing W3 Total Cache plugin, ranking went up and up.</p>
<p>My blog theme is not too heavy with loaded sidebars and fancy headers and footers but I smile when I see Google Page Speed Tool gives me 94 out of 100. </p>
<p>I want to thank the followings:</p>
<ol>
<li><a href="http://code.google.com/speed/page-speed/">Google Page Speed Tool</a></li>
<li><a href="http://developer.yahoo.com/yslow/">YSlow!</a></li>
<li><a href="http://wordpress.org/extend/plugins/w3-total-cache/">W3 Total Cache</a></li>
<li><a href="http://www.slidedeck.com/?ref=www.jayminkapish.com">SlideDeck</a></li>
<li><a href="http://www.wpzoom.com/">WPZoom</a></li>
<li><a href="http://www.wordpress.org/">WordPress</a></li>
</ol>
<p><em>If you like this theme, <a href="http://www.jayminkapish.com/contact-jaymin-patel/">contact me</a> and I will bundle it for you.</em></p>
<h3>Most Commented Posts</h3><ul class="related_post"><li><a href="http://www.jayminkapish.com/2008/06/13/comments-pagination-wordpress/" title="Comments Pagination &#8211; Wordpress &#8211; Bug Fixed!">Comments Pagination &#8211; Wordpress &#8211; Bug Fixed! (22)</a></li><li><a href="http://www.jayminkapish.com/2008/01/18/wordpress-database-schema/" title="Wordpress Database Schema">Wordpress Database Schema (13)</a></li><li><a href="http://www.jayminkapish.com/2009/06/16/date-archive-for-a-category/" title="Date archive for a category">Date archive for a category (10)</a></li><li><a href="http://www.jayminkapish.com/2008/02/07/migrate-from-utw-tags-to-wordpress-23-terms/" title="Migrate Tags from UTW Tags to Wordpress 2.3 Terms">Migrate Tags from UTW Tags to Wordpress 2.3 Terms (9)</a></li><li><a href="http://www.jayminkapish.com/2009/03/17/json-and-wordpress/" title="JSON and Wordpress">JSON and Wordpress (9)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.jayminkapish.com/2010/08/20/new-wordpress-theme-optimized-and-seo-friendly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress MU: accessing blogs from dropdown in admin bar</title>
		<link>http://www.jayminkapish.com/2010/05/17/wordpress-mu-accessing-blogs-from-dropdown-in-admin-bar/</link>
		<comments>http://www.jayminkapish.com/2010/05/17/wordpress-mu-accessing-blogs-from-dropdown-in-admin-bar/#comments</comments>
		<pubDate>Mon, 17 May 2010 17:50:39 +0000</pubDate>
		<dc:creator>Jaymin Patel</dc:creator>
				<category><![CDATA[KAPISH]]></category>

		<guid isPermaLink="false">http://www.jayminkapish.com/?p=223</guid>
		<description><![CDATA[This code snippet adds list of blogs that user has access to on MU site. Blogname links to blog's wp-admin, saving you time while jumping between different blogs.]]></description>
			<content:encoded><![CDATA[<p><span id="more-223"></span>
<div class="phpcode"><code>function my_blogs_listing($actions) {<br />
global $current_user;<br />
$blogs = get_blogs_of_user( $current_user-&gt;ID );<br />
$actions["#"] = array("<span style="text-decoration: underline;"><strong>*** My Blogs ***</strong></span>", 'edit_dashboard');<br />
foreach ($blogs as $blog) {<br />
$actions["{$blog-&gt;siteurl}/wp-admin/"] = array($blog-&gt;blogname, 'level_7');<br />
}<br />
return $actions;<br />
}<br />
add_filter('favorite_actions', 'my_blogs_listing');<br />
</code></div>
<p>This code snippet (can be used as a plugin) adds list of blogs that user has access to on MU site. Blogname links to blog&#8217;s wp-admin, saving you time.</p>
<h3>Most Commented Posts</h3><ul class="related_post"><li><a href="http://www.jayminkapish.com/2008/06/13/comments-pagination-wordpress/" title="Comments Pagination &#8211; Wordpress &#8211; Bug Fixed!">Comments Pagination &#8211; Wordpress &#8211; Bug Fixed! (22)</a></li><li><a href="http://www.jayminkapish.com/2008/01/18/wordpress-database-schema/" title="Wordpress Database Schema">Wordpress Database Schema (13)</a></li><li><a href="http://www.jayminkapish.com/2009/06/16/date-archive-for-a-category/" title="Date archive for a category">Date archive for a category (10)</a></li><li><a href="http://www.jayminkapish.com/2008/02/07/migrate-from-utw-tags-to-wordpress-23-terms/" title="Migrate Tags from UTW Tags to Wordpress 2.3 Terms">Migrate Tags from UTW Tags to Wordpress 2.3 Terms (9)</a></li><li><a href="http://www.jayminkapish.com/2009/03/17/json-and-wordpress/" title="JSON and Wordpress">JSON and Wordpress (9)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.jayminkapish.com/2010/05/17/wordpress-mu-accessing-blogs-from-dropdown-in-admin-bar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I&#039;m attending WordCampNYC!</title>
		<link>http://www.jayminkapish.com/2009/11/03/im-attending-wordcampnyc/</link>
		<comments>http://www.jayminkapish.com/2009/11/03/im-attending-wordcampnyc/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 18:44:50 +0000</pubDate>
		<dc:creator>Jaymin Patel</dc:creator>
				<category><![CDATA[KAPISH]]></category>

		<guid isPermaLink="false">http://blog.kapish.co.in/?p=192</guid>
		<description><![CDATA[I'm attending WordCampNYC!]]></description>
			<content:encoded><![CDATA[<p><center><a href="http://2009.newyork.wordcamp.org"  title="WordCampNYC – Nov 14-15"><img alt="WordCampNYC – Nov 14-15" src="http://2009.newyork.wordcamp.org/files/2009/10/wcnyc-attending-250.jpg" /></a></center></p>
<h3>Most Commented Posts</h3><ul class="related_post"><li><a href="http://www.jayminkapish.com/2008/06/13/comments-pagination-wordpress/" title="Comments Pagination &#8211; Wordpress &#8211; Bug Fixed!">Comments Pagination &#8211; Wordpress &#8211; Bug Fixed! (22)</a></li><li><a href="http://www.jayminkapish.com/2008/01/18/wordpress-database-schema/" title="Wordpress Database Schema">Wordpress Database Schema (13)</a></li><li><a href="http://www.jayminkapish.com/2009/06/16/date-archive-for-a-category/" title="Date archive for a category">Date archive for a category (10)</a></li><li><a href="http://www.jayminkapish.com/2008/02/07/migrate-from-utw-tags-to-wordpress-23-terms/" title="Migrate Tags from UTW Tags to Wordpress 2.3 Terms">Migrate Tags from UTW Tags to Wordpress 2.3 Terms (9)</a></li><li><a href="http://www.jayminkapish.com/2009/03/17/json-and-wordpress/" title="JSON and Wordpress">JSON and Wordpress (9)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.jayminkapish.com/2009/11/03/im-attending-wordcampnyc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress MU Site Upgrade Bug: Your server may not be able to connect to blogs running on it</title>
		<link>http://www.jayminkapish.com/2009/10/08/wordpress-mu-site-upgrade-bug-your-server-may-not-be-able-to-connect-to-blogs-running-on-it/</link>
		<comments>http://www.jayminkapish.com/2009/10/08/wordpress-mu-site-upgrade-bug-your-server-may-not-be-able-to-connect-to-blogs-running-on-it/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 19:37:40 +0000</pubDate>
		<dc:creator>Jaymin Patel</dc:creator>
				<category><![CDATA[KAPISH]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Wordpress MU 2.8.4]]></category>
		<category><![CDATA[Wordpress MU 2.8.4a]]></category>
		<category><![CDATA[Wordpress MU Site Upgrade]]></category>
		<category><![CDATA[wordpress-mu]]></category>

		<guid isPermaLink="false">http://blog.kapish.co.in/?p=180</guid>
		<description><![CDATA[Wordpress MU - Site Upgrade dies with message "Your server may not be able to connect to blogs running on it. Error message: 200: Operation timed out after 3 seconds with 0 bytes received"]]></description>
			<content:encoded><![CDATA[<p>I was upgrading mu site to 2.8.4. I went to Site Admin -> Upgrade and hit <strong>Upgrade Site</strong> button. It worked for first 25 &#8211; 30 blogs and then died with message</p>
<div class="phpcode"><code>Warning! Problem upgrading . Your server may not be able to connect to blogs running on it.<br />
Error message: 200: Operation timed out after 3 seconds with 0 bytes received<br />
</code></div>
<p><strong>This is what I did to fix my problem</strong></p>
<p>I opened wp-admin/wpmu-upgrade-site.php and wp-includes/http.php</p>
<div class="phpcode"><code>function &#038;_getTransport( $args = array() ) {</code></div>
<p>on line number 94 of wp-includes/http.php, wordpress tests different http request methods exist on your server during upgrade.</p>
<p>1st test was the culprit on my server which uses http_request method built into PHP. I guess this method was taking long time to resolve DNS and so it was timing out.</p>
<div class="phpcode"><code>if ( true === WP_Http_ExtHttp::test($args) ) {<br />
				$working_transport['exthttp'] = new WP_Http_ExtHttp();<br />
				$blocking_transport[] = &#038;$working_transport['exthttp'];<br />
			}</code></div>
<p>I did comment out this test and let WordPress start with next one.</p>
<div class="phpcode"><code>if ( true === WP_Http_Curl::test($args) ) {<br />
				$working_transport['curl'] = new WP_Http_Curl();<br />
				$blocking_transport[] = &#038;$working_transport['curl'];<br />
			}</code></div>
<p>And guess what? All 150 blogs were updated in a few minutes without any problem.</p>
<p><em>If even curl does not work for you, you can comment it out and move on to the next until WP upgrade site works for you.</em></p>
<p>Good Luck!</p>
<h3>Related Posts</h3><ul class="related_post"><li><a href="http://www.jayminkapish.com/2008/06/13/comments-pagination-wordpress/" title="Comments Pagination &#8211; Wordpress &#8211; Bug Fixed!">Comments Pagination &#8211; Wordpress &#8211; Bug Fixed! (22)</a></li><li><a href="http://www.jayminkapish.com/2010/09/30/wordpress-instant-search-plugin/" title="Wordpress Instant Search Plugin">Wordpress Instant Search Plugin (1)</a></li><li><a href="http://www.jayminkapish.com/2009/12/11/wordpress-mu-get-posts-pages-from-different-blogs-under-same-installation/" title="Wordpress MU: get posts/pages from different blogs under same installation">Wordpress MU: get posts/pages from different blogs under same installation (0)</a></li><li><a href="http://www.jayminkapish.com/2009/12/08/secure-your-wordpress-installation/" title="Secure Your Wordpress Installation">Secure Your Wordpress Installation (0)</a></li><li><a href="http://www.jayminkapish.com/2009/08/07/parent-child-theme-easiest-way/" title="Parent Child Theme &#8211; Easiest Way!">Parent Child Theme &#8211; Easiest Way! (0)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.jayminkapish.com/2009/10/08/wordpress-mu-site-upgrade-bug-your-server-may-not-be-able-to-connect-to-blogs-running-on-it/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>WordPress: Calculate font-size in Tag Cloud</title>
		<link>http://www.jayminkapish.com/2009/08/25/wordpress-calculate-font-size-in-tag-cloud/</link>
		<comments>http://www.jayminkapish.com/2009/08/25/wordpress-calculate-font-size-in-tag-cloud/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 14:38:49 +0000</pubDate>
		<dc:creator>Jaymin Patel</dc:creator>
				<category><![CDATA[KAPISH]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Tag Cloud]]></category>

		<guid isPermaLink="false">http://blog.kapish.co.in/?p=152</guid>
		<description><![CDATA[How to: calculate font-size in tag cloud]]></description>
			<content:encoded><![CDATA[<div class="phpcode"><code>$fontSizeUnits = "px";<br />
$fontSizeMin = 15;<br />
$fontSizeMax = 50;<br />
$maxValue = 12;<br />
$minValue = 1;<br />
</code></div>
<p>where <strong>$results</strong> is MySQL result set.</p>
<div class="phpcode"><code>foreach ($results as $result) {<br />
$tag = $result->name;<br />
$tagURI = get_option('home') . '/' . $result->taxonomy . '/' . $result->slug . '/';<br />
$count = $result->count;<br />
$weight = ( $count - $minValue ) / ( $maxValue - $minValue );<br />
$fontSize = $fontSizeMin + round( ($fontSizeMax - $fontSizeMin) * $weight );<br />
echo "&lt;li style='display: inline-block; font-size:". $fontSize. $fontSizeUnits."'&gt;&lt;a href=".$tagURI." title='(".$count." posts)'&gt;".$tag."&lt;/a&gt;&lt;/li&gt;";<br />
}<br />
</code></div>
<h3>Most Commented Posts</h3><ul class="related_post"><li><a href="http://www.jayminkapish.com/2008/06/13/comments-pagination-wordpress/" title="Comments Pagination &#8211; Wordpress &#8211; Bug Fixed!">Comments Pagination &#8211; Wordpress &#8211; Bug Fixed! (22)</a></li><li><a href="http://www.jayminkapish.com/2008/01/18/wordpress-database-schema/" title="Wordpress Database Schema">Wordpress Database Schema (13)</a></li><li><a href="http://www.jayminkapish.com/2009/06/16/date-archive-for-a-category/" title="Date archive for a category">Date archive for a category (10)</a></li><li><a href="http://www.jayminkapish.com/2008/02/07/migrate-from-utw-tags-to-wordpress-23-terms/" title="Migrate Tags from UTW Tags to Wordpress 2.3 Terms">Migrate Tags from UTW Tags to Wordpress 2.3 Terms (9)</a></li><li><a href="http://www.jayminkapish.com/2009/03/17/json-and-wordpress/" title="JSON and Wordpress">JSON and Wordpress (9)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.jayminkapish.com/2009/08/25/wordpress-calculate-font-size-in-tag-cloud/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Date archive for a category</title>
		<link>http://www.jayminkapish.com/2009/06/16/date-archive-for-a-category/</link>
		<comments>http://www.jayminkapish.com/2009/06/16/date-archive-for-a-category/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 16:52:53 +0000</pubDate>
		<dc:creator>Jaymin Patel</dc:creator>
				<category><![CDATA[KAPISH]]></category>
		<category><![CDATA[Date archive for a category]]></category>
		<category><![CDATA[wordpress archives for category]]></category>
		<category><![CDATA[wordpress-category-date-archive]]></category>

		<guid isPermaLink="false">http://blog.kapish.co.in/?p=78</guid>
		<description><![CDATA[How to build date archive for a category in wordpress.]]></description>
			<content:encoded><![CDATA[<p>There are a few ideas out there <strong>How to build date archive for a category</strong>. I am joining the race now.</p>
<p>Some of us, wordpress developers, may think this is hacky but I bet a few will like it this way because <strong>this works!</strong>.<br />
<span id="more-78"></span><br />
This idea would end up in url like this</p>
<div class="phpcode"><code>/archives/category/{category-slug}/yyyy/mm/</code></div>
<p>Lets get started and you can <a href="/wp-content/uploads/2009/06/date_archive_for_category.zip" title="Download php code - Date Archive for a category - wordpress">Download code here</a> and you can put that in your active theme&#8217;s functions.php file.</p>
<p>I am going to use <strong>init</strong> hook.</p>
<div class="phpcode">
<code>add_action('init','my_date_archive_for_category');</code>
</div>
<p>We can check if incoming request contains <strong>/archives/category/</strong> inside my_date_archive_for_category function. If it does, this is our category/date archive page.</p>
<p>Now breakup incoming request, and check every part of the request. We need category slug, year and month in place.</p>
<div class="phpcode">
<code>$request_parts = explode('/', $request);</code>
</div>
<p>Parts of request</p>
<div class="phpcode">
<code>Array ( [0] => [1] => archives [2] => category [3] => category-slug [4] => yyyy [5] => mm [6] => )</code>
</div>
<p>Here, we need to validate a few parts of the request like category slug, yyyy and mm.</p>
<div class="phpcode">
<code>$category_array = get_term_by('slug', $request_parts["3"], "category", ARRAY_A);</code>
</div>
<p>Now time to query wordpress.</p>
<div class="phpcode">
<code>query_posts(array('cat'=>$category_array["term_id"], 'year'=>$request_parts["4"], 'monthnum'=>$request_parts["5"]));</code>
</div>
<p>If we have posts, display them otherwise set a flag which we can use later to show 404 so visitors do not get confused.</p>
<div class="phpcode">
<code><br />
if ( have_posts() ) : while ( have_posts() ) : the_post();<br />
........<br />
endwhile;<br />
else:<br />
$is404 = true; /* set the flag so we know no posts found and display 404. */<br />
endif;<br />
</code>
</div>
<p><strong>DO NOT FORGET</strong> to put</p>
<div class="phpcode">
<code>exit;</code>
</div>
<p>at the end.</p>
<p>Putting <strong>exit</strong> at the end will end further PHP execution on your blog.</p>
<p>Do not forget to let me know how this works on your blog.</p>
<h3>Most Commented Posts</h3><ul class="related_post"><li><a href="http://www.jayminkapish.com/2008/06/13/comments-pagination-wordpress/" title="Comments Pagination &#8211; Wordpress &#8211; Bug Fixed!">Comments Pagination &#8211; Wordpress &#8211; Bug Fixed! (22)</a></li><li><a href="http://www.jayminkapish.com/2008/01/18/wordpress-database-schema/" title="Wordpress Database Schema">Wordpress Database Schema (13)</a></li><li><a href="http://www.jayminkapish.com/2009/06/16/date-archive-for-a-category/" title="Date archive for a category">Date archive for a category (10)</a></li><li><a href="http://www.jayminkapish.com/2008/02/07/migrate-from-utw-tags-to-wordpress-23-terms/" title="Migrate Tags from UTW Tags to Wordpress 2.3 Terms">Migrate Tags from UTW Tags to Wordpress 2.3 Terms (9)</a></li><li><a href="http://www.jayminkapish.com/2009/03/17/json-and-wordpress/" title="JSON and Wordpress">JSON and Wordpress (9)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.jayminkapish.com/2009/06/16/date-archive-for-a-category/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>JSON and WordPress</title>
		<link>http://www.jayminkapish.com/2009/03/17/json-and-wordpress/</link>
		<comments>http://www.jayminkapish.com/2009/03/17/json-and-wordpress/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 20:54:46 +0000</pubDate>
		<dc:creator>Jaymin Patel</dc:creator>
				<category><![CDATA[KAPISH]]></category>
		<category><![CDATA[decode-json-wordpress]]></category>
		<category><![CDATA[encode-json-wordpress]]></category>
		<category><![CDATA[json-wordpress]]></category>
		<category><![CDATA[wo]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://blog.kapish.co.in/?p=52</guid>
		<description><![CDATA[encode and decode JSON within wordpress using wordpress.]]></description>
			<content:encoded><![CDATA[<p>If you want to encode/decode JSON within/using wordpress, you can take a look at
<div class="inline-block right"><div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=187682461287759&amp;xfbml=1"></script><fb:like href="http://www.jayminkapish.com/2010/09/30/wordpress-instant-search-plugin/" send="false" layout="box_count" width="50" show_faces="false" font=""></fb:like>
<!-- Place this tag in your head or just before your close body tag -->
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<!-- Place this tag where you want the +1 button to render -->
<g:plusone size="tall"></g:plusone>
<a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-via="jayminkapish">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>
<p>/wp-includes/js/tinymce/plugins/spellchecker/classes/utils/JSON.php</p>
<p>This file has Moxiecode_JSON class which can do that for you.<br />
<span id="more-52"></span></p>
<p><strong>Sample code</strong></p>
<div class="phpcode">
<code>require_once(ABSPATH."/wp-includes/js/tinymce/plugins/spellchecker/classes/utils/JSON.php");<br />
$json_obj = new Moxiecode_JSON();<br />
/* encode */<br />
$json = $json_obj-&gt;encode(array("key1"=&gt;"value1","key2"=&gt;"value2"));<br />
//$json should have {"key1":"value1","key2":"value2"}<br />
/* decode */<br />
$json_array = $json_obj-&gt;decode($json);<br />
//$json_array will be an array("key1"=&gt;"value1","key2"=&gt;"value2")<br />
</code></div>
<h3>Related Posts</h3><ul class="related_post"><li><a href="http://www.jayminkapish.com/2010/09/30/wordpress-instant-search-plugin/" title="Wordpress Instant Search Plugin">Wordpress Instant Search Plugin (1)</a></li><li><a href="http://www.jayminkapish.com/2009/12/08/secure-your-wordpress-installation/" title="Secure Your Wordpress Installation">Secure Your Wordpress Installation (0)</a></li><li><a href="http://www.jayminkapish.com/2009/10/08/wordpress-mu-site-upgrade-bug-your-server-may-not-be-able-to-connect-to-blogs-running-on-it/" title="Wordpress MU Site Upgrade Bug: Your server may not be able to connect to blogs running on it">Wordpress MU Site Upgrade Bug: Your server may not be able to connect to blogs running on it (3)</a></li><li><a href="http://www.jayminkapish.com/2009/08/07/parent-child-theme-easiest-way/" title="Parent Child Theme &#8211; Easiest Way!">Parent Child Theme &#8211; Easiest Way! (0)</a></li><li><a href="http://www.jayminkapish.com/2008/06/13/comments-pagination-wordpress/" title="Comments Pagination &#8211; Wordpress &#8211; Bug Fixed!">Comments Pagination &#8211; Wordpress &#8211; Bug Fixed! (22)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.jayminkapish.com/2009/03/17/json-and-wordpress/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Back in USA</title>
		<link>http://www.jayminkapish.com/2009/02/04/back-in-usa/</link>
		<comments>http://www.jayminkapish.com/2009/02/04/back-in-usa/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 21:26:25 +0000</pubDate>
		<dc:creator>Jaymin Patel</dc:creator>
				<category><![CDATA[India]]></category>
		<category><![CDATA[KAPISH]]></category>
		<category><![CDATA[USA]]></category>
		<category><![CDATA[Vacation]]></category>
		<category><![CDATA[india trip]]></category>
		<category><![CDATA[kite fastival]]></category>
		<category><![CDATA[makarsakranti]]></category>

		<guid isPermaLink="false">http://blog.kapish.co.in/?p=39</guid>
		<description><![CDATA[Hi Everyone. I&#8217;m back in the business! I decided I will write about my trip the same day I was landed in USA but I was caught up checking 1,000 emails and work load. It&#8217;s always great going back home and meeting your people. I enjoyed a lot this time in India. Hanging out with [...]]]></description>
			<content:encoded><![CDATA[<p>Hi Everyone. I&#8217;m back in the business!</p>
<p>I decided I will write about my trip the same day I was landed in USA but I was caught up checking 1,000 emails and work load.</p>
<p>It&#8217;s always great going back home and meeting your people. I enjoyed a lot this time in India. Hanging out with friends, family regroup, my grandmother and a lot! This year I relaxed a bit as well and some days were so busy. Kite Fastival, Uttarayana or Makarsakranti was too good. I fly kites after 2 years.<br />
<span id="more-39"></span><br />
Still transfering pictures from my camera and an iPhone to my new MacBook. I&#8217;ll upload them to Flickr sometime today. There are 900 pictures. WOW!</p>
<p>I remember I was not quite happy coming back in Dec 2007. But this time, I&#8217;m happy. Jasmin and Jay stayed there so missing them a lot but it&#8217;s a matter of 8 weeks only. Since I was away for 3 weeks, first 3 days just passed but missing them a lot today. Do not know how these 8 weeks will go.</p>
<p>Jasmin was asking me this morning &#8220;Are you coming here on Valentine Day?&#8221;. I said &#8220;I want to but there is no chance&#8221;. I wish, I could.</p>
<p>I&#8217;ll have to update Jay&#8217;s blog as well. I did not write to his blog for last 4 months. That&#8217;s a big project!</p>
<p>So.. back to work now! Trying to keep myself a lot busy!!</p>
<h3>Most Commented Posts</h3><ul class="related_post"><li><a href="http://www.jayminkapish.com/2008/06/13/comments-pagination-wordpress/" title="Comments Pagination &#8211; Wordpress &#8211; Bug Fixed!">Comments Pagination &#8211; Wordpress &#8211; Bug Fixed! (22)</a></li><li><a href="http://www.jayminkapish.com/2008/01/18/wordpress-database-schema/" title="Wordpress Database Schema">Wordpress Database Schema (13)</a></li><li><a href="http://www.jayminkapish.com/2009/06/16/date-archive-for-a-category/" title="Date archive for a category">Date archive for a category (10)</a></li><li><a href="http://www.jayminkapish.com/2008/02/07/migrate-from-utw-tags-to-wordpress-23-terms/" title="Migrate Tags from UTW Tags to Wordpress 2.3 Terms">Migrate Tags from UTW Tags to Wordpress 2.3 Terms (9)</a></li><li><a href="http://www.jayminkapish.com/2009/03/17/json-and-wordpress/" title="JSON and Wordpress">JSON and Wordpress (9)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.jayminkapish.com/2009/02/04/back-in-usa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress: Automatically adjust for daylight saving time</title>
		<link>http://www.jayminkapish.com/2008/11/12/wordpress-automatically-adjust-for-daylight-saving-time/</link>
		<comments>http://www.jayminkapish.com/2008/11/12/wordpress-automatically-adjust-for-daylight-saving-time/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 17:55:36 +0000</pubDate>
		<dc:creator>Jaymin Patel</dc:creator>
				<category><![CDATA[KAPISH]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[daylight saving time]]></category>
		<category><![CDATA[daylight saving time and wordpress]]></category>
		<category><![CDATA[daylight saving time wordpress plugin]]></category>
		<category><![CDATA[wordpress and daylight saving time]]></category>
		<category><![CDATA[wordpress timezone settings]]></category>

		<guid isPermaLink="false">http://blog.kapish.co.in/?p=29</guid>
		<description><![CDATA[Wordpress Plugin to adjust daylight saving time automatically.]]></description>
			<content:encoded><![CDATA[<p>I have been googling for this and (again) I had to come up with my own solution.</p>
<div class="phpcode">
<pre>
<code>function my_set_gmt_offset($offset) {
        global $wpdb;

        /* WordPress default sets to UTC timezone
        in wp-settings.php.
        you can change this line to whatever your timezone is.
        I set it to my timezone (NY)
        More: http://www.php.net/manual/en/timezones.php
        */

        if(function_exists('date_default_timezone_set'))
	        date_default_timezone_set('America/New_York');

	$timezone = date("T");

        /* Now we have your local timezone stored in $timezone
        so lets restore wordpress setting as in wp-settings.php */

        if ( function_exists('date_default_timezone_set') )
	       date_default_timezone_set('UTC');

	$current_offset = $offset;

	if($timezone == 'EDT') {
		$offset = '-4';
	}
	else if($timezone == 'EST') {
		$offset = '-5';
	}

	if($offset != $current_offset) {
		/* update offset in database if new offset is different.
		   Do not use update_option since it will call
                   this filter again and cause infinite loop.
		 */
		$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->options
		SET option_value = %s WHERE
		option_name = %s", $offset, 'gmt_offset' ) );

		/* let wordpress regenerate cache from database */
		wp_cache_set('gmt_offset', 'checkthedatabaseplease', 'options');
	}

	return $offset;
}

add_filter('option_gmt_offset', 'my_set_gmt_offset');
</code></pre>
</div>
<p>Share your feedback via comments.</p>
<h3>Most Commented Posts</h3><ul class="related_post"><li><a href="http://www.jayminkapish.com/2008/06/13/comments-pagination-wordpress/" title="Comments Pagination &#8211; Wordpress &#8211; Bug Fixed!">Comments Pagination &#8211; Wordpress &#8211; Bug Fixed! (22)</a></li><li><a href="http://www.jayminkapish.com/2008/01/18/wordpress-database-schema/" title="Wordpress Database Schema">Wordpress Database Schema (13)</a></li><li><a href="http://www.jayminkapish.com/2009/06/16/date-archive-for-a-category/" title="Date archive for a category">Date archive for a category (10)</a></li><li><a href="http://www.jayminkapish.com/2008/02/07/migrate-from-utw-tags-to-wordpress-23-terms/" title="Migrate Tags from UTW Tags to Wordpress 2.3 Terms">Migrate Tags from UTW Tags to Wordpress 2.3 Terms (9)</a></li><li><a href="http://www.jayminkapish.com/2009/03/17/json-and-wordpress/" title="JSON and Wordpress">JSON and Wordpress (9)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.jayminkapish.com/2008/11/12/wordpress-automatically-adjust-for-daylight-saving-time/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Comments Pagination &#8211; WordPress &#8211; Bug Fixed!</title>
		<link>http://www.jayminkapish.com/2008/06/13/comments-pagination-wordpress/</link>
		<comments>http://www.jayminkapish.com/2008/06/13/comments-pagination-wordpress/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 20:09:09 +0000</pubDate>
		<dc:creator>Jaymin Patel</dc:creator>
				<category><![CDATA[KAPISH]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[code-snippet]]></category>
		<category><![CDATA[comments-pagination]]></category>
		<category><![CDATA[wordpress 2.3]]></category>
		<category><![CDATA[wordpress blog]]></category>
		<category><![CDATA[wordpress-2.5]]></category>
		<category><![CDATA[wordpress-mu]]></category>

		<guid isPermaLink="false">http://blog.kapish.co.in/?p=28</guid>
		<description><![CDATA[Comment pagination for wordpress 2.5 or MU. You can grab the code and create a plugin if you want to. Share your feedback via comments.]]></description>
			<content:encoded><![CDATA[<p>Actually, I did not create a plugin but I wrote a code snippet that did this job for me.</p>
<p><strong><em>Add these lines to comments.php in your active theme folder.</em></strong></p>
<div class="phpcode">
<code>$comments_per_page = 5;<br />
global $post;<br />
$total = $post->comment_count;<br />
if($total &gt; 0) {<br />
$apage=isset($_GET['apage']) ? intval($_GET['apage']) : 1;<br />
$comments=array_slice($comments, intval(($apage-1)*$comments_per_page),intval($comments_per_page));<br />
}<br />
</code>
</div>
<p><strong><em>Insert this code right after <code>if ($comments) </code>statement</em></strong></p>
<div class="phpcode">
<code>$commentCounter = (($apage-1)*$comments_per_page);<br />
$from_page = $commentCounter+1;<br />
if($apage == 1) {<br />
$to_page = $comments_per_page;<br />
if($total &lt; $to_page) {<br />
$to_page = $total;<br />
}<br />
}<br />
else {<br />
$to_page = $from_page + $comments_per_page - 1;<br />
if($to_page &gt; $total) {<br />
$to_page = $total;<br />
}<br />
}<br />
</code>
</div>
<p><strong><em>Insert this line where you want page links to appear in comments.php.</em></strong></p>
<div class="phpcode">
<code>&lt;?php echo paginate_links( array(<br />
'base' =&gt; add_query_arg( 'apage', '%#%#comments' ),<br />
'format' =&gt; '',<br />
'total' =&gt; ceil($total / intval($comments_per_page)),<br />
'current' =&gt; $apage<br />
));<br />
</code>
</div>
<p>I think this is it. It should work. Give it a try and share your feedback via comments.</p>
<h3>Related Posts</h3><ul class="related_post"><li><a href="http://www.jayminkapish.com/2009/10/08/wordpress-mu-site-upgrade-bug-your-server-may-not-be-able-to-connect-to-blogs-running-on-it/" title="Wordpress MU Site Upgrade Bug: Your server may not be able to connect to blogs running on it">Wordpress MU Site Upgrade Bug: Your server may not be able to connect to blogs running on it (3)</a></li><li><a href="http://www.jayminkapish.com/2008/02/07/migrate-from-utw-tags-to-wordpress-23-terms/" title="Migrate Tags from UTW Tags to Wordpress 2.3 Terms">Migrate Tags from UTW Tags to Wordpress 2.3 Terms (9)</a></li><li><a href="http://www.jayminkapish.com/2010/09/30/wordpress-instant-search-plugin/" title="Wordpress Instant Search Plugin">Wordpress Instant Search Plugin (1)</a></li><li><a href="http://www.jayminkapish.com/2009/12/11/wordpress-mu-get-posts-pages-from-different-blogs-under-same-installation/" title="Wordpress MU: get posts/pages from different blogs under same installation">Wordpress MU: get posts/pages from different blogs under same installation (0)</a></li><li><a href="http://www.jayminkapish.com/2009/12/08/secure-your-wordpress-installation/" title="Secure Your Wordpress Installation">Secure Your Wordpress Installation (0)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.jayminkapish.com/2008/06/13/comments-pagination-wordpress/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: www.jayminkapish.com @ 2012-02-06 04:12:33 by W3 Total Cache -->
