<?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>Solid State Raam &#187; WordPress</title>
	<atom:link href="http://solidstateraam.com/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://solidstateraam.com</link>
	<description>Explorations (and exploitations) of the digital world by one of its many netizens.</description>
	<lastBuildDate>Sat, 17 Dec 2011 20:18:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Including Custom Post Type in Default WordPress RSS Feed</title>
		<link>http://solidstateraam.com/including-custom-post-type-in-default-wordpress-rss-feed/</link>
		<comments>http://solidstateraam.com/including-custom-post-type-in-default-wordpress-rss-feed/#comments</comments>
		<pubDate>Sat, 17 Dec 2011 20:18:47 +0000</pubDate>
		<dc:creator>Raam</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://solidstateraam.com/?p=665</guid>
		<description><![CDATA[To control what post types show up in the default WordPress RSS feed, you can add a function to your themes functions.php file (if one doesn&#8217;t exist, create it in your theme folder) to control what is returned when the RSS feed is requested. If we wanted to modify this so that the default feed [...]]]></description>
			<content:encoded><![CDATA[<p>To control what post types show up in the default WordPress RSS feed, you can add a function to your themes <code>functions.php</code> file (if one doesn&#8217;t exist, create it in your theme folder) to control what is returned when the RSS feed is requested.</p>
<pre class="brush: php; title: ; notranslate">
function myfeed_request($qv) {
	// If a request for the RSS feed is made, but the request
	// isn't specifically for a Custom Post Type feed
	if (isset($qv['feed']) &amp;&amp; !isset($qv['post_type'])) {
		// Return a feed with posts of post type 'post'
		$qv['post_type'] = array('post');
	}

	return $qv;
}
add_filter('request', 'myfeed_request');
</pre>
<p>If we wanted to modify this so that the default feed includes <code>'post'</code> and a entries from <a href="http://codex.wordpress.org/Post_Types#Custom_Types">Custom Post Type</a> <code>'thoughts'</code>, we can modify the function as follows:</p>
<pre class="brush: php; title: ; notranslate">
function myfeed_request($qv) {
	// If a request for the RSS feed is made, but the request
	// isn't specifically for a Custom Post Type feed
	if (isset($qv['feed']) &amp;&amp; !isset($qv['post_type'])) {
		// Return a feed with posts of post type 'post' and 'thoughts'
		$qv['post_type'] = array('post', 'thoughts');
	}

	return $qv;
}
add_filter('request', 'myfeed_request');
</pre>
]]></content:encoded>
			<wfw:commentRss>http://solidstateraam.com/including-custom-post-type-in-default-wordpress-rss-feed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Use the New Facebook Like Button</title>
		<link>http://solidstateraam.com/how-to-use-the-new-facebook-like-button/</link>
		<comments>http://solidstateraam.com/how-to-use-the-new-facebook-like-button/#comments</comments>
		<pubDate>Thu, 13 May 2010 19:24:28 +0000</pubDate>
		<dc:creator>Raam</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Social Media]]></category>

		<guid isPermaLink="false">http://solidstateraam.com/?p=626</guid>
		<description><![CDATA[Facebook recently (within the past few weeks) released a new feature that allows for &#8220;Liking&#8221; practically anything on the web. This is pretty damn powerful, and apparently in less than a week of its availability, 50,000 websites thought so too. Have you seen these new Facebook Like buttons at the bottom of some blog posts? [...]]]></description>
			<content:encoded><![CDATA[<p>Facebook recently (within the past few weeks) released a new feature that allows for &#8220;Liking&#8221; <em>practically anything on the web</em>. This is pretty damn powerful, and apparently in less than a week of its availability, <a href="http://mashable.com/2010/04/28/facebook-social-plugins/">50,000 websites thought so too</a>. </p>
<p>Have you seen these new Facebook Like buttons at the bottom of some blog posts? Here&#8217;s what they look like:</p>
<p><a href="http://solidstateraam.com/wp-content/uploads/2010/05/facebook-like-button.png"><img src="http://solidstateraam.com/wp-content/uploads/2010/05/facebook-like-button.png" alt="" title="facebook-like-button" width="275" height="43" class="alignnone size-full wp-image-629" /></a></p>
<p>Initially, I glossed over them assuming they were the same thing as the &#8220;Become a Fan&#8221; buttons (which are now, confusingly, also &#8220;Like&#8221; buttons). However, these individual Like buttons are specifically for liking the blog post itself. </p>
<p>When you click on the Like button at the bottom of a blog post, an entry gets added to your Facebook timeline stating that you liked the post (assuming you&#8217;re logged into Facebook). For example, here you can see that I &#8220;Liked&#8221; one of my blog posts, <a href="http://raamdev.com/the-pursuit-of-knowledge">The Pursuit of Knowledge</a>:</p>
<p><a href="http://solidstateraam.com/wp-content/uploads/2010/05/facebook-like-button-status-update.png"><img src="http://solidstateraam.com/wp-content/uploads/2010/05/facebook-like-button-status-update.png" alt="" title="facebook-like-button-status-update" width="480" height="154" class="alignnone size-full wp-image-630" /></a></p>
<h3>6 Reasons why all bloggers need to add this button to their posts</h3>
<p>If the potential of this Like button isn&#8217;t already obvious, let me give you 6 reasons why you should be adding it to your own blog posts right now:</p>
<ol>
<li>Facebook has over 425 million users; chances are that many of your readers use the network. If you&#8217;re already using a Retweet button for Twitter, there&#8217;s no reason you shouldn&#8217;t be using the Facebook Like button.</li>
<li>The Like button is familiar to Facebook users. They already know what it does and they&#8217;ve probably used it several times on Facebook. This familiarity brings comfort and increases the chances they will use it.</li>
<li>Liking a post is a seamless operation for readers already logged into Facebook; one click and it&#8217;s done!</li>
<li>By liking a post, the reader tells all his or her Facebook friends about your blog post, greatly amplifying your blog&#8217;s exposure.</li>
<li>If other Facebook friends have already Liked the post, their names will be displayed next to the button. This creates a sense of trust and community and increases the chances your reader will also Like the post (creating even more exposure).</li>
<li>You can configure the Like button to show not only the names of the friends, but also their profile pictures! This further amplifies the comfort level of your reader and encourages them to share your blog post.</li>
</ol>
<p>One other thing to note as a blogger is that the Like button isn&#8217;t tied to your Facebook account or Fan page. When a reader likes your blog post, the message that shows up on the readers Facebook timeline links directly back to your blog. This is great because the potential for exposure is huge &#8212; a reader doesn&#8217;t need to be your Fan or friend on Facebook to share your content!</p>
<h3>How to integrate the Facebook Like button on a WordPress blog</h3>
<p>For WordPress blogs, I prefer adding the Like button using a WordPress plugin <a href="http://wordpress.org/extend/plugins/fblikebutton/">like this one</a>. However if you just want to add the Like button to your theme manually, you can drop this snippet of code in your theme&#8217;s <strong>single.php</strong> file, just after the line that includes the <code>the_content(); </code> function:</p>
<pre class="brush: xml; title: ; wrap-lines: true; notranslate">&lt;iframe src=&quot;http://www.facebook.com/plugins/like.php?href=&lt;?php echo urlencode(get_permalink($post-&gt;ID)); ?&gt;&amp;amp;layout=standard&amp;amp;show_faces=false&amp;amp;width=450&amp;amp;action=like&amp;amp;colorscheme=light&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; allowTransparency=&quot;true&quot; style=&quot;border:none; overflow:hidden; width:450px; height:60px;&quot;&gt;&lt;/iframe&gt;</pre>
<p>For more information, including extra parameters for modifying the behavior of the button, check out the <a href="http://developers.facebook.com/docs/reference/plugins/like">Facebook Developers Documentation</a> page.</p>
]]></content:encoded>
			<wfw:commentRss>http://solidstateraam.com/how-to-use-the-new-facebook-like-button/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Restricting WordPress Tags by Category</title>
		<link>http://solidstateraam.com/restricting-wordpress-tags-by-category/</link>
		<comments>http://solidstateraam.com/restricting-wordpress-tags-by-category/#comments</comments>
		<pubDate>Fri, 07 May 2010 17:32:20 +0000</pubDate>
		<dc:creator>Raam</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Tagging]]></category>
		<category><![CDATA[WordPress Themes]]></category>

		<guid isPermaLink="false">http://solidstateraam.com/?p=617</guid>
		<description><![CDATA[Have you ever needed to display category tags? If you want to only display the tags associated with a specific category, unfortunately the built-in WordPress functions will not suffice. Why such basic functionality has to this day not been added to WordPress is beyond me. Thankfully, after much frustration and research, I have found a [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever needed to display category tags? If you want to only display the tags associated with a specific category, unfortunately the built-in WordPress functions will not suffice. Why such basic functionality has to this day not been added to WordPress is beyond me.</p>
<p>Thankfully, after much frustration and research, I have found a working solution using a plugin called Sensitive Tag Cloud. You can visit the <a href="http://www.rene-ade.de/inhalte/wordpress-plugin-sensitivetagcloud.html">plugin home page</a>, or download the plugin from the <a href="http://wordpress.org/extend/plugins/sensitive-tag-cloud/">official WordPress Plugin page</a>.</p>
<p>Once you have installed and activated the plugin, access the configuration page (<strong>Appearance -> SensitiveTagCloud</strong>) and ensure that the &#8220;Restricted to current category&#8221; option is enabled.</p>
<p>Now to display the tags for a specific category when you&#8217;re browsing that category, edit the <code>archives.php</code> file for your theme and find the section related to browsing by category:</p>
<pre class="brush: php; title: ; notranslate">
          &lt;?php /* If this is a category archive */ if (is_category()) { ?&gt;
                &lt;h1 class=&quot;pagetitle&quot;&gt;Category: &lt;?php single_cat_title(); ?&gt;&lt;/h1&gt;
</pre>
<p>Now, right below that second line, insert the following function to call SensitiveTagCloud:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
  if( function_exists(&quot;stc_widget&quot;) )
    stc_widget();
?&gt;
</pre>
<p>You can also wrap the function in a div if you want to style it. Here&#8217;s how my <code>archive.php</code> file looks now (minus the unrelated sections of code):</p>
<pre class="brush: php; title: ; notranslate">
          &lt;?php /* If this is a category archive */ if (is_category()) { ?&gt;
                &lt;h1 class=&quot;pagetitle&quot;&gt;Browsing: &lt;?php single_cat_title(); ?&gt;&lt;/h1&gt;
&lt;div style=&quot;background:#EAF3F3 none repeat scroll 0 0; border: 1px solid #D0D8D8; padding: 20px;&quot;&gt;
&lt;?php
  if( function_exists(&quot;stc_widget&quot;) )
    stc_widget();
?&gt;
&lt;/div&gt;
</pre>
<p>And with those changes, here&#8217;s how my Category pages now look:</p>
<p><a href="http://solidstateraam.com/wp-content/uploads/2010/05/tags-by-category-raamdev.png"><img src="http://solidstateraam.com/wp-content/uploads/2010/05/tags-by-category-raamdev-300x174.png" alt="" title="tags-by-category-raamdev" width="300" height="174" class="alignnone size-medium wp-image-620" /></a></p>
<p>This allows for browsing the tags associated with a specific category, while eliminating irrelevant tags. I write on a variety of topics, so there are a lot of tags that are unrelated or that would be out of context. For example, the &#8220;Blogging&#8221; tag in the Personal Development category would likely mean something different than the same tag in the Technology category (the latter having more to do with technical things like this article on WordPress).</p>
]]></content:encoded>
			<wfw:commentRss>http://solidstateraam.com/restricting-wordpress-tags-by-category/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moving WordPress to a New URL and New Permalink Structure</title>
		<link>http://solidstateraam.com/moving-wordpress-to-a-new-url-and-new-permalink-structure/</link>
		<comments>http://solidstateraam.com/moving-wordpress-to-a-new-url-and-new-permalink-structure/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 03:01:25 +0000</pubDate>
		<dc:creator>Raam</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Apache]]></category>

		<guid isPermaLink="false">http://solidstateraam.com/?p=545</guid>
		<description><![CDATA[When I decided to change the permalink structure and move my WordPress blog from blog.raamdev.com to raamdev.com, I knew it was going to be a delicate process. I have over a thousand posts, more than three hundred of which have been indexed by Google. A huge portion of my traffic comes from Google, so my [...]]]></description>
			<content:encoded><![CDATA[<p>When I decided to change the permalink structure and move my WordPress blog from blog.raamdev.com to raamdev.com, I knew it was going to be a delicate process. I have over a thousand posts, more than three hundred of which have been indexed by Google. A huge portion of my traffic comes from Google, so my biggest concern was that the old URLs redirect to the new location.</p>
<h3>Step 1: Disable plugins</h3>
<p>It&#8217;s a good idea to disable your plugins before making these changes. At the very least, if you have a caching plugin installed (such as WP Super Cache), delete the cache and then disable that plugin.</p>
<h3>Step 2: Change the blog URL</h3>
<p>First, I had to change the WordPress blog URL from blog.raamdev.com to raamdev.com/blog/. This is simply a matter of updating the &#8220;WordPress address&#8221; and &#8220;Blog address&#8221; options from within the WordPress Administration panel (Settings -> General).</p>
<p>Second, I wanted the final URL to be raamdev.com/, instead of raamdev.com/blog/. To do this, I first changed the &#8220;Blog address&#8221; to raamdev.com/. Now to get WordPress working on the webroot (raamdev.com/), I had to move /blog/index.php to the webroot (/index.php) and then edit index.php and change this line,</p>
<pre class="brush: plain; title: ; notranslate">
require('./wp-blog-header.php');
</pre>
<p>to this,</p>
<pre class="brush: plain; title: ; notranslate">
require('./blog/wp-blog-header.php');
</pre>
<p>Now, when index.php is loaded, it knows to look for all the WordPress files in /blog/ and since WordPress has been configured to use raamdev.com/ as the &#8220;Blog address&#8221;, it will automatically handle everything else.</p>
<h3>Step 3: Redirect old URLs to the new URL</h3>
<p>The <code>blog.</code> sub-domain maps to a directory in the webroot called <code>/blog/</code>. If someone visits a link to a page that includes the sub-domain, the web server needs to tell the browser the new location. To do this, I needed to recreate the /blog/ directory and add the following to an <code>.htaccess</code> file:</p>
<pre class="brush: plain; title: ; notranslate">
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^blog\.raamdev\.com$ [NC]
RewriteRule ^(.*)$ http://raamdev.com/blog/$1 [R=301,L]
</pre>
<p>Now, if someone tries to visit http://blog.raamdev.com/2010/01/28/some-blog-post, the web server will do a 301 redirect to http://raamdev.com/blog/2010/01/28/some-blog-post.</p>
<blockquote><p><strong>What&#8217;s a 301 redirect?</strong> Well, when you move a web page from one location to another, you can specify the type of redirection. A <a href="http://en.wikipedia.org/wiki/URL_redirection#HTTP_status_codes_3xx">301 redirect</a> means the web page has been moved permanently. This is useful for keeping indexes updated. For example, if someone searches Google and finds an old link, Google will detect the 301 redirect and update its index with the new URL, thereby keeping your URL&#8217;s pagerank.</p></blockquote>
<h3>Step 4: Change Permalink structure</h3>
<p>To change the permalink structure, I used the awesome <a href="http://www.deanlee.cn/wordpress/permalinks-migration-plugin/" target="_new">Permalink Migration plugin by Dean Lee</a>. With this plugin, I just specify the old permalink structure (in my case, this was <code>/%year%/%monthnum%/%postname%/</code>) and then change the permalink structure in WordPress (Settings -> Permalinks) to the new format (I&#8217;m using <code>/%postname%/</code>). </p>
<p>Now whenever someone visits a URL using the old permalink structure, Dean&#8217;s plugin sends a 301 redirect to the new URL.</p>
<h3>Summary</h3>
<p>With the <code>.htaccess</code> rewrite rule and Dean&#8217;s Permalink Migration plugin, we now have a double 301 redirect to make sure the old URLs redirect to the new ones:</p>
<ol>
<li>Someone searches Google and finds this link to my site: http://blog.raamdev.com/2010/01/28/some-blog-post</li>
<li>The <code>.htaccess</code> rule rewrites the URL and redirects: http://raamdev.com/blog/2010/01/28/some-blog-post
</li>
<li>Dean&#8217;s Permalink Migration plugin redirects to the new permalink structure: http://raamdev.com/blog/some-blog-post</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://solidstateraam.com/moving-wordpress-to-a-new-url-and-new-permalink-structure/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

