<?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>/home/shakir &#187; wordpress</title>
	<atom:link href="http://www.mohdshakir.net/tag/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://www.mohdshakir.net</link>
	<description></description>
	<lastBuildDate>Mon, 04 Jul 2011 14:50:11 +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>How to create a WordPress plugin</title>
		<link>http://www.mohdshakir.net/2007/12/17/how-to-create-a-wordpress-plugin</link>
		<comments>http://www.mohdshakir.net/2007/12/17/how-to-create-a-wordpress-plugin#comments</comments>
		<pubDate>Mon, 17 Dec 2007 13:02:00 +0000</pubDate>
		<dc:creator>Mohd Shakir</dc:creator>
				<category><![CDATA[computing]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.mohdshakir.net/2007/12/17/how-to-create-a-wordpress-plugin</guid>
		<description><![CDATA[<p>Posted in <a href="http://www.mohdshakir.net/category/computing" title="computing">computing</a></p>I&#8217;m into writing a plugin for WordPress, and so let me just share here how easy it is to actually create one. For an example, we&#8217;re going to write a plugin that will insert a Google Adsense to our blog post. From our WordPress installation directory, create a file named google_adds.php in the wp-contents/plugins/ directory [...]]]></description>
			<content:encoded><![CDATA[<p>Posted in <a href="http://www.mohdshakir.net/category/computing" title="computing">computing</a></p><p>I&#8217;m into writing a plugin for WordPress, and so let me just share here how easy it is to actually create one.</p>
<p>For an example, we&#8217;re going to write a plugin that will insert a Google Adsense to our blog post.</p>
<p>From our WordPress installation directory, create a file named <em>google_adds.php</em> in the <em>wp-contents/plugins/</em> directory and add these lines;&nbsp;</p>
<pre>
&lt;?php
/*
Plugin Name: Google Adsense
Version: 0.1
Plugin URI: www.mohdshakir.net
Description: This plugin will display Google Adsense in every post
Author: Mohd Shakir bin Zakaria
Author URI: www.mohdshakir.net
*/
?&gt;
</pre>
<p>To see what it does, login to your WordPress admin panel and go to the Plugins section.</p>
<p><a href="http://www.mohdshakir.net/wp-content/uploads/image/200712/wordpress-plugins.png" rel="lightbox[120]"><img src="http://www.mohdshakir.net/wp-content/uploads/image/200712/wordpress-plugins-mini.png" alt="" /></a></p>
<p>As what can be seen from the screenshot, the information of the plugins there were taken from the comments on our plugin code. We can now activate the plugin, but for now our plugin doesn&#8217;t really do anything useful.</p>
<p>Let&#8217;s go back to our PHP code, and add some lines to be as the following</p>
<pre>
&lt;?php
/*
Plugin Name: Google Adsense
Version: 0.1
Plugin URI: http://www.mohdshakir.net
Description: This plugin will display Google Adsense in every post
Author: Mohd Shakir bin Zakaria
Author URI: http://www.mohdshakir.net
*/

function adsense($text){

        $adsense_code = &lt;&lt;&lt;EOT
# Add your own Adsense code here
EOT;

        return $adsense_code . &quot;&lt;br \&gt;&quot;  .$text;
}

/*
  Add filter is a built in WordPress function, and the_content
  is a WordPress variable of a single post content.
*/
add_filter('the_content', 'adsense');

?&gt;
</pre>
<p>Let&#8217;s see if it works</p>
<p><a href="http://www.mohdshakir.net/wp-content/uploads/image/200712/wordpress-frontpage.png" rel="lightbox[120]"><img src="http://www.mohdshakir.net/wp-content/uploads/image/200712/wordpress-frontpage-mini.png" alt="" /></a></p>
<p>That&#8217;s it, our first fully functioning Google Adsense plugin <img src='http://www.mohdshakir.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.mohdshakir.net/2007/12/17/how-to-create-a-wordpress-plugin/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Installing Smiletag Shoutbox in WordPress</title>
		<link>http://www.mohdshakir.net/2007/12/10/installing-smiletag-shoutbox-in-wordpress</link>
		<comments>http://www.mohdshakir.net/2007/12/10/installing-smiletag-shoutbox-in-wordpress#comments</comments>
		<pubDate>Mon, 10 Dec 2007 00:20:53 +0000</pubDate>
		<dc:creator>Mohd Shakir</dc:creator>
				<category><![CDATA[computing]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.mohdshakir.net/2007/12/10/installing-smiletag-shoutbox-in-wordpress</guid>
		<description><![CDATA[<p>Posted in <a href="http://www.mohdshakir.net/category/computing" title="computing">computing</a></p>Smiletag Shoutbox is the shoutbox that I have on my website&#8217;s sidebar. I&#8217;ve been using it since I was using Joomla for my website, and now that I moved to WordPress, Smiletag is still my shoutbox of choice. Installing it in Joomla is very straightforward, while it&#8217;s not really the case with WordPress, as it [...]]]></description>
			<content:encoded><![CDATA[<p>Posted in <a href="http://www.mohdshakir.net/category/computing" title="computing">computing</a></p><p>Smiletag Shoutbox is the shoutbox that I have on my website&#8217;s sidebar. I&#8217;ve been using it since I was using <a href="http://www.joomla.org">Joomla</a> for my website, and now that I moved to <a href="http://www.wordpress.org">WordPress</a>, Smiletag is still my shoutbox of choice.</p>
<p>Installing it in Joomla is very straightforward, while it&#8217;s not really the case with WordPress, as it requires a little bit of coding.</p>
<p>The application can be downloaded from <a href="http://www.hiveminds.co.uk/node/3203">Hivemind&#8217;s website</a> (requires free registration)&nbsp; and it can then be installed as any other WordPress plugin. The shoutbox however doesn&#8217;t immediately show up in the page, and there&#8217;s no option in the admin console for that.</p>
<p>To add it to the page we must add some codes, and in our case, to the sidebar&#8217;s code. Edit it from the admin panel;</p>
<pre>Presentation -> Theme Editor -> sidebar.php</pre>
<p>or can be edited with any editor;</p>
<pre>/path/to/current/template/sidebar.php</pre>
<p>This is an example of a very simple WordPress template with widget support;</p>
<pre lang="php" line="1">
<ul id="sidebar">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(1) ) : ?>
<?php endif; ?>
</ul>
</pre>
<p>The sidebar uses <font face="Courier New">&lt;ul&gt;</font> for its items, and so we need to add <font face="Courier New">&lt;li&gt;</font> element to add our shoutbox (and probably any other static stuff) to it. We also need to add a header (<font face="Courier New">&lt;h2&gt;</font> probably) for the item&#8217;s title, and add the shoutbox&#8217;s code to it. The final sidebar should look something like this;</p>
<pre lang="php" line="1">
<ul id="sidebar">
<li>
<h2>Shoutbox</h2>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" >
        <iframe name="iframetag" marginwidth="0" marginheight="0" src="<?php smiletag_getview(); ?>" width="190" height="300">
                        Your Browser must support IFRAME to view
                        this page correctly
                </iframe>
                </td>
</tr>
<tr>
<td>
        <?php smiletag_getscript(); ?>
<form name="smiletagform" method="post" action="<?php smiletag_getpost(); ?>" target="iframetag">
              Name
<input type="text" name="name"/>
              URL or Email
<input type="text" name="mail_or_url" value="http://" />
              Message<textarea name="message_box" rows="3" cols="20"></textarea>
<input type="hidden" name="message" value="" />
<input type="submit" name="submit" value="Tag!" onclick="clearMessage()" />
<input type="reset"  name="reset" value="Reset" />
            </form>
</td>
</tr>
</table>
</li>

<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(1) ) : ?>
<?php endif; ?>
</ul>
</pre>
<p>This might not exactly be the case with every template, but the idea is about the same. Happy blogging!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mohdshakir.net/2007/12/10/installing-smiletag-shoutbox-in-wordpress/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

