<?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>KAPISH::Blog &#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>About Me and Wordpress</description>
	<lastBuildDate>Wed, 14 Jul 2010 18:51:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=3.0-alpha</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<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><img src="http://www.jayminkapish.com/wp-content/uploads/2010/05/blogs_listing_in_admin_bar.png" alt="Accessing Blogs from Dropdown in admin bar" /></p>
<div class="phpcode" style="margin: -385px 10px 10px;width:60%;float:right;"><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! (19)</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 (6)</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! (19)</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 (6)</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! (19)</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 (2)</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/2009/03/17/json-and-wordpress/" title="JSON and Wordpress">JSON and Wordpress (6)</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! (19)</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 (6)</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>0</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! (19)</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 (6)</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</p>
<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/2009/12/08/secure-your-wordpress-installation/" title="Secure Your Wordpress Installation">Secure Your Wordpress Installation (2)</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! (19)</a></li><li><a href="http://www.jayminkapish.com/2008/04/16/google-shared-items-in-posts/" title="Google Shared Items in post using shortcode">Google Shared Items in post using shortcode (0)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.jayminkapish.com/2009/03/17/json-and-wordpress/feed/</wfw:commentRss>
		<slash:comments>6</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 friends, family [...]]]></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! (19)</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 (6)</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! (19)</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 (6)</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/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 (2)</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/2008/06/13/comments-pagination-wordpress/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Flickr photos in post using shortcode</title>
		<link>http://www.jayminkapish.com/2008/04/23/flickr-photos-in-post-using-shortcode/</link>
		<comments>http://www.jayminkapish.com/2008/04/23/flickr-photos-in-post-using-shortcode/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 19:15:10 +0000</pubDate>
		<dc:creator>Jaymin Patel</dc:creator>
				<category><![CDATA[KAPISH]]></category>
		<category><![CDATA[Flickr]]></category>
		<category><![CDATA[photos]]></category>
		<category><![CDATA[shortcodes-api]]></category>
		<category><![CDATA[wordpress-shortcodes]]></category>

		<guid isPermaLink="false">http://blog.kapish.co.in/?p=26</guid>
		<description><![CDATA[Shortcodes API in wordpress is worth to use for any kind of HTML code in your content to make post content clean and manageable. This is an example of showing flickr photos in your post content. This way you can upload your trip pictures to flickr set and write about them on your blog. how is it?]]></description>
			<content:encoded><![CDATA[<p>Shortcodes are awesome! This time I am showing photos from <a title="jayminkapish on Flickr" href="http://www.flickr.com/people/jayminkapish/" target="_blank">my flickr account</a> to wordpress post.</p>
<p><strong>Content from X'Mas in NY</strong></p>
<h3>Related Posts</h3><ul class="related_post"><li><a href="http://www.jayminkapish.com/2008/04/16/google-shared-items-in-posts/" title="Google Shared Items in post using shortcode">Google Shared Items in post using shortcode (0)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.jayminkapish.com/2008/04/23/flickr-photos-in-post-using-shortcode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: www.jayminkapish.com @ 2010-07-30 06:29:56 by W3 Total Cache -->