<?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>MySandbox &#187; wordpress</title>
	<atom:link href="http://sandbox.ronggur.com/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://sandbox.ronggur.com</link>
	<description>Ronggur Hutasuhut Playground</description>
	<lastBuildDate>Mon, 31 Oct 2011 10:39:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>WordPress : How to get category ancestor</title>
		<link>http://sandbox.ronggur.com/2011/10/31/wordpress-how-to-get-category-ancestor/</link>
		<comments>http://sandbox.ronggur.com/2011/10/31/wordpress-how-to-get-category-ancestor/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 17:15:36 +0000</pubDate>
		<dc:creator>ronggur</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://sandbox.ronggur.com/?p=267</guid>
		<description><![CDATA[Here is code I usually use to find ancestor or parent of a category I know this code is premature, it&#8217;s only works when you didn&#8217;t modify the category slug. But at least it is working in almost all my (&#8230;)</p><p><a href="http://sandbox.ronggur.com/2011/10/31/wordpress-how-to-get-category-ancestor/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Here is code I usually use to find ancestor or parent of a category</p>
<pre class="brush: php; title: ; notranslate">

function getCategoryAncestor($cat,$index=0){

$parentCatList = get_category_parents($cat,false,',');
$parentCatListArray = @split(&quot;,&quot;,$parentCatList);
$topParentName = $parentCatListArray[$index];
$charReplace = array(&quot; &quot; =&gt; &quot;-&quot;, &quot;(&quot; =&gt; &quot;&quot;, &quot;)&quot; =&gt; &quot;&quot;);
$topParentSlug = strtolower(strtr($topParentName,$charReplace));
$catAncestor['ancestor'] = $topParentName;
$catAncestor['ancestor_slug'] = $topParentSlug;
return $catAncestor;

}

// How to use :
// if you have this category (by term ID) structure : 1 &gt; 2 &gt; 3
// to get ancestor of a category ID 3

$ancestors = getCategoryAncestor(3);

// to get parent of a category ID 3

$ancestors = getCategoryAncestor(3,1);
</pre>
<p>I know this code is premature, it&#8217;s only works when you didn&#8217;t modify the category slug. But at least it is working in almost all my projects :p.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://sandbox.ronggur.com/2011/10/31/wordpress-how-to-get-category-ancestor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress : Custom Action Hook in Action</title>
		<link>http://sandbox.ronggur.com/2011/08/09/wordpress-custom-action-hook-in-action/</link>
		<comments>http://sandbox.ronggur.com/2011/08/09/wordpress-custom-action-hook-in-action/#comments</comments>
		<pubDate>Tue, 09 Aug 2011 12:48:30 +0000</pubDate>
		<dc:creator>ronggur</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Wordpress Plugins]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress plugin]]></category>

		<guid isPermaLink="false">http://sandbox.ronggur.com/?p=253</guid>
		<description><![CDATA[There are two types of hook in WordPress, filter and action. And in this occasion I will try to give examples about Actions hook. According to codex.wordpress.org: Actions: Actions are the hooks that the WordPress core launches at specific points (&#8230;)</p><p><a href="http://sandbox.ronggur.com/2011/08/09/wordpress-custom-action-hook-in-action/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>There are two types of hook in WordPress, <a href="http://codex.wordpress.org/Plugin_API#Filters" onclick="pageTracker._trackPageview('/outgoing/codex.wordpress.org/Plugin_API_Filters?referer=');">filter</a> and <a href="http://codex.wordpress.org/Plugin_API#Actions" onclick="pageTracker._trackPageview('/outgoing/codex.wordpress.org/Plugin_API_Actions?referer=');">action</a>. And in this occasion I will try to give examples about Actions hook.</p>
<p>According to codex.wordpress.org:</p>
<p><a title="" href="http://codex.wordpress.org/Plugin_API#Actions" onclick="pageTracker._trackPageview('/outgoing/codex.wordpress.org/Plugin_API_Actions?referer=');">Actions</a>: Actions are the hooks that the WordPress core launches at specific points during execution, or when specific events occur. Your plugin can specify that one or more of its PHP functions are executed at these points, using the Action API.</p>
<p>You can find more complete explanation about this hooks in <a href="http://codex.wordpress.org/Plugin_API" onclick="pageTracker._trackPageview('/outgoing/codex.wordpress.org/Plugin_API?referer=');">http://codex.wordpress.org/Plugin_API</a> and right now I only give simple example to create custom hook that would give us benefit if we want to build wordpress plugin.</p>
<p><span id="more-253"></span></p>
<h3>1. Initialize Our Hook</h3>
<p>You can put this code in any of your plugin files</p>
<pre class="brush: php; title: ; notranslate">
function my_first_hook(){
// initialize hook
do_action('my_act_first_hook');
}
</pre>
<h3>2. Adding Action</h3>
<pre class="brush: php; title: ; notranslate">
function my_first_action(){
echo 'This is my first hook';
}
add_action('my_act_first_hook','my_first_action',5);
</pre>
<p><em><strong>remember</strong></em> : &#8217;5&#8242; at the end of the add_action is priority. 5 mean lower than 4 to execute and the default value is 10</p>
<h3>3. Execute it</h3>
<p>Now, we only need to call our function from the first Step in every your php files</p>
<pre class="brush: php; title: ; notranslate">
my_first_hook();
</pre>
<p>This function will produce</p>
<blockquote><p>This is my first hook</p></blockquote>
<p>That&#8217;s all we&#8217;re finish. <span style="text-decoration: underline;"><em>&#8220;Really? how about if I want to append other text to my hook?&#8221;</em></span>. All you need is only create another function and call it via add_action. Here it is how to do this :</p>
<pre class="brush: php; title: ; notranslate">
function append_another_text(){
echo '. Append new text';
}
add_action('my_act_first_hook','append_another_text',6);
</pre>
<p>Code above will produce</p>
<blockquote><p>This is my first hook. Append new text</p></blockquote>
<p>See the &#8217;6&#8242;? change it to lower number than 5 and your text will appear before the original one. <span style="text-decoration: underline;"><em>&#8220;Cool, But how about if I want to pass argument into this hook?&#8221;</em></span><span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13px; line-height: 19px; white-space: normal;">. Good question, all you need is only change your code a bit. here it is</span></p>
<pre class="brush: php; title: ; notranslate">
function my_first_hook($arg){
do_action('my_act_first_hook',$arg);
}
function my_first_action($arg){
echo 'This is my first hook with '.$arg;
}
add_action('my_act_first_hook','my_first_action',5,1);
</pre>
<p><span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13px; line-height: 19px; white-space: normal;">and call it to your php files</span></p>
<pre class="brush: php; title: ; notranslate">
my_first_hook('Argument');
</pre>
<p>And the code above should produce</p>
<blockquote><p>This is my first hook with Argument</p></blockquote>
<p>Not too complicated right?.</p>
<p><span style="text-decoration: underline;"><em>&#8220;How about if i want to completely remove the original text and change it with the new one?&#8221;</em></span>.</p>
<p>There is also answer about that one. You only need to call <a href="http://codex.wordpress.org/Function_Reference/remove_action" onclick="pageTracker._trackPageview('/outgoing/codex.wordpress.org/Function_Reference/remove_action?referer=');">remove_action</a>. Here it is how to do this.</p>
<h3>1. Remove previous action</h3>
<pre class="brush: php; title: ; notranslate">
function remove_text(){
	remove_action('my_act_first_hook','my_first_action');
}
add_action('init','remove_text');
</pre>
<h3>2. Create your new brand new function</h3>
<pre class="brush: php; title: ; notranslate">
function brand_new_text_action(){
echo 'Brand new text';
}
add_action('my_act_first_hook','brand_new_text_action');
</pre>
<p>That&#8217;s it, want to see real action in form of plugin? you can download it here <a href="http://sandbox.ronggur.com/wp-content/plugins/download-monitor/download.php?id=10" title="Action Hook in Action">Action Hook in Action</a> | size : 4.75 kB</p>
<p>Thank You, hope this article is usefull for us</p>
]]></content:encoded>
			<wfw:commentRss>http://sandbox.ronggur.com/2011/08/09/wordpress-custom-action-hook-in-action/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RH Yahoo! Messenger WordPress Plugin</title>
		<link>http://sandbox.ronggur.com/2011/05/24/rh-yahoo-messenger-wordpress-plugin/</link>
		<comments>http://sandbox.ronggur.com/2011/05/24/rh-yahoo-messenger-wordpress-plugin/#comments</comments>
		<pubDate>Tue, 24 May 2011 06:16:45 +0000</pubDate>
		<dc:creator>ronggur</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Wordpress Plugins]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress plugin]]></category>

		<guid isPermaLink="false">http://sandbox.ronggur.com/?p=231</guid>
		<description><![CDATA[Hi, there. In this post I want to introduce my first WordPress plugin . This plugin is a widget plugin that will shows multiple Yahoo! Messenger Status of your own. So here it is.. Installation The plugin is simple to (&#8230;)</p><p><a href="http://sandbox.ronggur.com/2011/05/24/rh-yahoo-messenger-wordpress-plugin/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Hi, there. In this post I want to introduce my first WordPress plugin <img src='http://sandbox.ronggur.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . This plugin is a widget plugin that will shows multiple Yahoo! Messenger Status of your own. So here it is..</p>
<h3>Installation</h3>
<p>The plugin is simple to use:</p>
<p>1. Download `rh-ym-status.zip` you can download here <a href="http://sandbox.ronggur.com/wp-content/plugins/download-monitor/download.php?id=9" title="RH Yahoo! Messenger Status WP Plugin">RH Yahoo! Messenger Status WP Plugin</a> | size : 66.22 kB<br />
2. Unzip<br />
3. Upload `rh-ym-status` directory to your `/wp-content/plugins` directory<br />
4. Enable the plugin via plugin managament page<br />
5. Go to widget area and fill your Yahoo Name(s) and Yahoo ID(s) to show your Yahoo! Messenger status in widget area</p>
<p><span id="more-231"></span></p>
<h3>Screen Shot</h3>
<p><a href="http://sandbox.ronggur.com/wp-content/uploads/2011/05/screenshoot.png"><img class="alignnone size-medium wp-image-237" title="screenshot" src="http://sandbox.ronggur.com/wp-content/uploads/2011/05/screenshoot-300x283.png" alt="" width="300" height="283" /></a></p>
<h3>Download</h3>
<a href="http://sandbox.ronggur.com/wp-content/plugins/download-monitor/download.php?id=9" title="RH Yahoo! Messenger Status WP Plugin">RH Yahoo! Messenger Status WP Plugin</a> | size : 66.22 kB
<p>For bugs reporting, please send your email to wp.plugins@ronggur.com. And feel free to leave any comments <img src='http://sandbox.ronggur.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://sandbox.ronggur.com/2011/05/24/rh-yahoo-messenger-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>WordPress : Get page permalink by name, slug or title outside loop</title>
		<link>http://sandbox.ronggur.com/2011/04/19/wordpressget-page-permalink-by-name-title-outside-loop/</link>
		<comments>http://sandbox.ronggur.com/2011/04/19/wordpressget-page-permalink-by-name-title-outside-loop/#comments</comments>
		<pubDate>Tue, 19 Apr 2011 08:07:14 +0000</pubDate>
		<dc:creator>ronggur</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[jquery tutorial]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[Wordpress Themes]]></category>

		<guid isPermaLink="false">http://sandbox.ronggur.com/?p=217</guid>
		<description><![CDATA[I know we have get_permalink() in WordPress to get permalink by id of specific page. So this post is only alternative how to get the permalink by name, slug or title. 1. Get Page ID by name, slug or title (&#8230;)</p><p><a href="http://sandbox.ronggur.com/2011/04/19/wordpressget-page-permalink-by-name-title-outside-loop/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I know we have <a href="http://codex.wordpress.org/Function_Reference/get_permalink" onclick="pageTracker._trackPageview('/outgoing/codex.wordpress.org/Function_Reference/get_permalink?referer=');">get_permalink()</a> in WordPress to get permalink by id of specific page. So this post is only alternative how to get the permalink by name, slug or title.</p>
<h4>1. Get Page ID by name, slug or title</h4>
<pre class="brush: php; title: ; notranslate">
&lt;?php
function rh_get_page_id($name)
{
global $wpdb;
// get page id using custom query
$page_id = $wpdb-&gt;get_var(&quot;SELECT ID FROM $wpdb-&gt;posts WHERE ( post_name = '&quot;.$name.&quot;' or post_title = '&quot;.$name.&quot;' ) and post_status = 'publish' and post_type='page' &quot;);
return $page_id;
}
?&gt;
</pre>
<p><span id="more-217"></span></p>
<h4>2. Get Page Permalink by name, slug or title</h4>
<pre class="brush: php; title: ; notranslate">
&lt;?php
function rh_get_page_permalink($name)
{
$page_id = rh_get_pageid($name);
return get_permalink($page_id);
}
?&gt;
</pre>
<h4>3. How To Use</h4>
<pre class="brush: php; title: ; notranslate">
&lt;?php
// get by title
echo rh_get_page_permalink('Your Page Name');
// get by name or slug
echo rh_get_page_permalink('your-page-name');
?&gt;
</pre>
<p>Enjoy.. I hope it useful and works for you <img src='http://sandbox.ronggur.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div id="_mcePaste" class="mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">http://codex.wordpress.org/Function_Reference/get_permalinkget</div>
]]></content:encoded>
			<wfw:commentRss>http://sandbox.ronggur.com/2011/04/19/wordpressget-page-permalink-by-name-title-outside-loop/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>WordPress Theme : January</title>
		<link>http://sandbox.ronggur.com/2009/01/06/wordpress-theme-january/</link>
		<comments>http://sandbox.ronggur.com/2009/01/06/wordpress-theme-january/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 10:36:36 +0000</pubDate>
		<dc:creator>ronggur</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Wordpress Themes]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp theme]]></category>

		<guid isPermaLink="false">http://sandbox.ronggur.com/?p=3</guid>
		<description><![CDATA[Here is my first wordpress theme for public. I named it January. This theme is 2 columns layout theme with widget ready on sidebar. This design is released under a Creative Commons Attribution 3.0 License: http://creativecommons.org/licenses/by/3.0/. Right now the demo (&#8230;)</p><p><a href="http://sandbox.ronggur.com/2009/01/06/wordpress-theme-january/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<div id="attachment_4" class="wp-caption alignnone" style="width: 310px"><img class="size-medium wp-image-4" title="Wordpress Theme : January" src="http://sandbox.ronggur.com/wp-content/uploads/2009/01/preview-300x164.jpg" alt="Wordpress Theme : January" width="300" height="164" /><p class="wp-caption-text">WordPress Theme : January, 2 columns theme with widget ready on sidebar</p></div>
<p>Here is my first wordpress theme for public. I named it January. This theme is 2 columns layout theme with widget ready on sidebar. This design is released under a Creative Commons Attribution 3.0 License: <a href="http://creativecommons.org/licenses/by/3.0/" onclick="pageTracker._trackPageview('/outgoing/creativecommons.org/licenses/by/3.0/?referer=');">http://creativecommons.org/licenses/by/3.0/.</a></p>
<p>Right now the demo page is unvailable but i&#8217;ll try to create it as soon as possible. I release this theme with &#8216;menu.psd&#8217; to create menu manually.</p>
<p>Please send me email if there&#8217;s bug to <em><strong>me[at]ronggur.com</strong></em>. Thank you and have fun</p>
<p>Thank&#8217; to <a title="http://www.somerandomdude.net" href="http://www.somerandomdude.net" onclick="pageTracker._trackPageview('/outgoing/www.somerandomdude.net?referer=');">P.J. Onori</a>, I use his <em>bitcons</em> for <em>january theme</em></p>
<p>Download link : <a class="downloadlink" href="http://sandbox.ronggur.com/wp-content/plugins/download-monitor/download.php?id=1" title="Version1.0 downloaded 294 times" >WordPress Theme  January (294)</a></p>
<p><strong>*/update January 08, 2009 &#8211; 11.11 PM GMT+7 : </strong>i added some classes for wp calendar. Thank&#8217;s to <a title="hadi ariawan" href="http://hadiariawan.web.id" onclick="pageTracker._trackPageview('/outgoing/hadiariawan.web.id?referer=');">ariawan</a> for correcting me. you can donwload style sheet directory here <a class="downloadlink" href="http://sandbox.ronggur.com/wp-content/plugins/download-monitor/download.php?id=2" title=" downloaded 266 times" >Update style wordpress theme : January (266)</a>.  After you download it, please replace the style directory inside january theme directory.</p>
<p><strong>*/update January 07, 2009 &#8211; 3.07 PM GMT+7</strong> : now i give link to the plain html. But it is only the homepage <a title="wordpres theme : january" href="http://dock.ronggur.com/wp-theme/january-html/" onclick="pageTracker._trackPageview('/outgoing/dock.ronggur.com/wp-theme/january-html/?referer=');">click here</a> to find out</p>
<p><strong>*/update January 07, 2009 GMT+7 </strong>: For you <em>who downloaded this theme before January 7 2009</em>,  please delete below css code in style.css</p>
<pre class="brush: css; title: ; notranslate">
.aligncenter {
display: block;
margin-left: auto;
margin-right: auto;
}

.alignleft {
float: left;
}

.alignright {
float: right;
}
</pre>
<p>or place it after</p>
<pre class="brush: css; title: ; notranslate">
@import url('styles/reset.css');
@import url('styles/text.css');
@import url('styles/default.css');
</pre>
<p>Somehow it makes the styles didn&#8217;t work. Sorry my mistake.</p>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="ronggur.mh@gmail.com" /><input type="hidden" name="return" value="Thank you for your kindness :D" /><input type="hidden" name="item_name" value="Buy Me a Beer for WordPress Theme : January" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="" /><input type="image" src="http://sandbox.ronggur.com/wp-content/plugins/buy-me-beer/icon_cafe.gif" align="left" alt="coffee" title="coffee" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=ronggur.mh@gmail.com&amp;currency_code=USD&amp;amount=&amp;return=Thank you for your kindness :D&amp;item_name=Buy+Me+a+Beer+for+Wordpress+Theme+:+January" target="paypal" onclick="pageTracker._trackPageview('/outgoing/www.paypal.com/cgi-bin/webscr?cmd=_xclick_amp_business=ronggur.mh_gmail.com_amp_currency_code=USD_amp_amount=_amp_return=Thank_you_for_your_kindness_D_amp_item_name=Buy+Me+a+Beer+for+Wordpress+Theme+_+January&amp;referer=');">You can give me some coffee if you want to :D</a></p>]]></content:encoded>
			<wfw:commentRss>http://sandbox.ronggur.com/2009/01/06/wordpress-theme-january/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: sandbox.ronggur.com @ 2012-02-04 23:13:09 -->
