<?xml version="1.0" encoding="UTF-8"?>
<rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Amit Verma</title>
	
	<link>http://amit.me</link>
	<description>A walk along technology river</description>
	<lastBuildDate>Sun, 13 May 2012 15:40:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/amitv" /><feedburner:info uri="amitv" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Happy New Year 2011</title>
		<link>http://feedproxy.google.com/~r/amitv/~3/zMBwvh_ETqc/656</link>
		<comments>http://amit.me/happy-new-year-2011/656#comments</comments>
		<pubDate>Fri, 31 Dec 2010 15:49:21 +0000</pubDate>
		<dc:creator>Amit Verma</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://amit.me/?p=656</guid>
		<description><![CDATA[I wish all of you a very Happy New Year. Yet another year with lots of hopes; hope for better increment, hope for flat tummy, hope for better environment etc. I am hoping to achieve followings in 2011. Resolution list 2011 First of all, regular blog posts, at least one post every two weeks Keep [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img class="aligncenter size-full wp-image-657" title="Wish you all a very-very Happy New Year" src="http://amit.me/wp-content/uploads/2010/12/Shillong-20100707-1865.jpg" alt="Happy New Year" width="675" height="448" /></p>
<p>I wish all of you a very Happy New Year.</p>
<p>Yet another year with lots of hopes; hope for better increment, hope for flat tummy, hope for better environment etc. I am hoping to achieve followings in 2011.</p>
<h3>Resolution list 2011</h3>
<ul>
<li>First of all, regular blog posts, at least one post every two weeks</li>
<li>Keep upgrading my computing skills</li>
<li>Restart <a href="http://weconscious.com" target="_blank">We Conscious</a></li>
<li>Work on at least 2 websites (<a href="http://wordpressable.me">wordpressable.me</a> and <a href="http://spambase.net">spambase.net</a>) for which I have registered domain names</li>
<li>Start developing for mobile devices especially for iPhone and iPad</li>
<li>Keep my place clean and also educate people to do so</li>
<li>Pursue my hobby of Photography</li>
<li>Reduce expenses and increase savings</li>
<li>Reduce my weight to 62KGs with flat belly (I am working hard for this) <img src='http://amit.me/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
</ul>
<p><strong>What are you hoping to achieve in 2011?</strong></p>
<img src="http://feeds.feedburner.com/~r/amitv/~4/zMBwvh_ETqc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://amit.me/happy-new-year-2011/656/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://amit.me/happy-new-year-2011/656</feedburner:origLink></item>
		<item>
		<title>Image SEO</title>
		<link>http://feedproxy.google.com/~r/amitv/~3/12R7ttyxY-w/642</link>
		<comments>http://amit.me/image-seo/642#comments</comments>
		<pubDate>Sun, 07 Nov 2010 17:36:31 +0000</pubDate>
		<dc:creator>Amit Verma</dc:creator>
				<category><![CDATA[Internet]]></category>

		<guid isPermaLink="false">http://amit.me/?p=642</guid>
		<description><![CDATA[When we think of SEO, we all think of optimizing content and web pages. But images also play an important role in driving traffic to your site. Here are a few tips from Google Webmasters to optimize images for Search Engines. Informative image names If the image names are self explanatory, it increases its visibility [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>When we think of SEO, we all think of optimizing content and web pages. But images also play an important role in driving traffic to your site.</p>
<p>Here are a few tips from <a href="http://www.google.com/webmasters/" target="_blank">Google Webmasters</a> to optimize images for Search Engines.</p>
<h3>Informative image names</h3>
<p>If the image names are self explanatory, it increases its visibility e.g., <em>chandni-chowk.jpg </em>instead of <em>IMG456829.jpg</em>. Always use keywords in image name.</p>
<h3>Appropriate ALT text</h3>
<p>The alt attribute describes the content of an image. This information is used to determine the best image to return for a user&#8217;s query. An alt text should be a description not keywords. Filling alt attributes with keywords (<a href="http://www.google.com/support/webmasters/bin/answer.py?answer=66358" target="_blank">Keyword stuffing</a>) results in a bad user experience and can cause the website to be counted as spam.</p>
<h3>Content around image</h3>
<p>The page the image is on and the content around the image (including any captions or image titles), provide search engines with important information about the image. It is recommended to provide good, descriptive titles and captions for your images. It is good to place images near the relevant text.</p>
<h3>Don&#8217;t embed text inside images</h3>
<p>Search Engines can’t read text embedded within the image. It is good to put content in HTML rather than in the image.</p>
<img src="http://feeds.feedburner.com/~r/amitv/~4/12R7ttyxY-w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://amit.me/image-seo/642/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://amit.me/image-seo/642</feedburner:origLink></item>
		<item>
		<title>Hide  and Unhide friends from News Feed on Facebook</title>
		<link>http://feedproxy.google.com/~r/amitv/~3/3Ir3t_DJKg8/630</link>
		<comments>http://amit.me/hide-and-unhide-friends-from-news-feed-on-facebook/630#comments</comments>
		<pubDate>Fri, 17 Sep 2010 05:04:23 +0000</pubDate>
		<dc:creator>Amit Verma</dc:creator>
				<category><![CDATA[Social Network]]></category>

		<guid isPermaLink="false">http://amit.me/?p=630</guid>
		<description><![CDATA[News Feed is your Facebook homepage where you get updates from your Facebook friends, Pages etc. If you don&#8217;t want to hear regular updates from some of your Facebook Friends, you can hide them from News Feed. Hiding someone from News Feed Take your mouse to the news item, a X button will appear in [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>News Feed is your Facebook homepage where you get updates from your Facebook friends, Pages etc.</p>
<p>If you don&#8217;t want to hear regular updates from some of your Facebook Friends, you can hide them from News Feed.</p>
<h3><strong>Hiding someone from News Feed</strong></h3>
<p>Take your mouse to the news item, a <strong>X</strong> button will appear in the right-to corner of the news item.</p>
<p><img class="aligncenter size-full wp-image-631" title="Hide button - Facebook" src="http://amit.me/wp-content/uploads/2010/09/hidebutton-facebook.png" alt="Hide News Story - Facebook" width="532" height="170" /></p>
<p>When you click the <strong>X</strong> button, it will ask you to hide the person or mark as spam. Click on Hide button to hide the friend.</p>
<p><img class="aligncenter size-full wp-image-632" title="Hide Button - Facebook" src="http://amit.me/wp-content/uploads/2010/09/hidebutton1-facebook.png" alt="Hide Button - Facebook" width="503" height="62" /></p>
<h3>Unhiding  hidden Facebook friend</h3>
<ol>
<li>Scroll down to the bottom of your News Feed and click &#8220;Edit Options.&#8221;<img class="aligncenter size-full wp-image-633" title="NewsFeedEditButton-facebook" src="http://amit.me/wp-content/uploads/2010/09/NewsFeedEditButton-facebook.png" alt="" width="531" height="43" /></li>
<li>Remove your friend from Hide section by clicking on  <strong>X</strong> button against your friend&#8217;s name.<img class="aligncenter size-full wp-image-634" title="News Feed Preference - Facebook" src="http://amit.me/wp-content/uploads/2010/09/news-feed-preference-facebook.png" alt="News Feed Preference - Facebook" width="630" height="443" /></li>
<li>Click &#8220;Save&#8221; to save your changes.</li>
</ol>
<h3>More Settings</h3>
<ul>
<li>You can adjust the number of friends visible on your News Feed.</li>
<li>Type a name under Show more to add more friends to show on News Feed.</li>
<li>To hide, use text box under Hide section.</li>
<li>To edit recommended friends, click on &#8220;View recommended friends&#8221; link.</li>
</ul>
<img src="http://feeds.feedburner.com/~r/amitv/~4/3Ir3t_DJKg8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://amit.me/hide-and-unhide-friends-from-news-feed-on-facebook/630/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://amit.me/hide-and-unhide-friends-from-news-feed-on-facebook/630</feedburner:origLink></item>
		<item>
		<title>Stop receiving notification messages after you comment on a photo : Facebook</title>
		<link>http://feedproxy.google.com/~r/amitv/~3/LaNOoD4DmC8/621</link>
		<comments>http://amit.me/stop-receiving-notification-messages-after-you-comment-on-a-photo-facebook/621#comments</comments>
		<pubDate>Wed, 08 Sep 2010 17:43:34 +0000</pubDate>
		<dc:creator>Amit Verma</dc:creator>
				<category><![CDATA[Social Network]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[facebook photo notification]]></category>
		<category><![CDATA[social media]]></category>

		<guid isPermaLink="false">http://amit.me/?p=621</guid>
		<description><![CDATA[I had commented on a photo of my friend’s wedding on Facebook. When I checked my inbox an hour later, there were 22 comment notifications from Facebook. It really get annoying when you comment on someone’s photo and there after you receive a long trail of emails. But there is a way to stop getting [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I had commented on a photo of my friend’s wedding on Facebook. When I checked my inbox an hour later, there were 22 comment notifications from Facebook.</p>
<p>It really get annoying when you comment on someone’s photo and there after you receive a long trail of emails. But there is a way to stop getting these emails.</p>
<p>Simply go to the <a href="http://www.facebook.com/editaccount.php?notifications" target="_blank">Notifications</a> tab of the Account page.</p>
<div id="attachment_622" class="wp-caption aligncenter" style="width: 675px">
	<img class="size-full wp-image-622" title="facebook-notification-setting" src="http://amit.me/wp-content/uploads/2010/09/facebook-notification-setting.png" alt="Facebook Notifications Settings" width="675" height="139" />
	<p class="wp-caption-text">Facebook Notifications Settings</p>
</div>
<p>Deselect <strong>Comments after you on a photo</strong> and <strong>Comments after you on a photo album </strong>options under the Photos section.</p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<div id="attachment_623" class="wp-caption aligncenter" style="width: 463px">
	<img class="size-full wp-image-623" title="facebook-photo-notification-setting" src="http://amit.me/wp-content/uploads/2010/09/facebook-photo-notification-setting.png" alt="Facebook Photos Notification Setting" width="463" height="242" />
	<p class="wp-caption-text">Facebook Photos Notification Setting</p>
</div>
<img src="http://feeds.feedburner.com/~r/amitv/~4/LaNOoD4DmC8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://amit.me/stop-receiving-notification-messages-after-you-comment-on-a-photo-facebook/621/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://amit.me/stop-receiving-notification-messages-after-you-comment-on-a-photo-facebook/621</feedburner:origLink></item>
		<item>
		<title>How useful an Actionless form could be</title>
		<link>http://feedproxy.google.com/~r/amitv/~3/ZdN0Nfo9XHw/606</link>
		<comments>http://amit.me/how-useful-an-actionless-form-could-be/606#comments</comments>
		<pubDate>Thu, 26 Aug 2010 12:43:13 +0000</pubDate>
		<dc:creator>Amit Verma</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[asp.net postback]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[HTML form]]></category>
		<category><![CDATA[URL Rewriting]]></category>

		<guid isPermaLink="false">http://amit.me/?p=606</guid>
		<description><![CDATA[This article is relevant to ASP.NET. Knowledge of HTML and ASP.Net is required. I was working on a project where I had to implement URL rewriting. I was also working on a tool to update a site’s (let’s say a.com) content. The tool was hosted on another domain (b.com). I had to use images and [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><em>This article is relevant to <a class="zem_slink" title="ASP.NET" rel="homepage" href="http://www.asp.net">ASP.NET</a>. Knowledge of HTML and ASP.Net is required.</em></p>
<p>I was working on a project where I had to implement URL rewriting. I was also working on a tool to update a site’s (let’s say <em>a.com</em>) content. The tool was hosted on another domain (<em>b.com</em>). I had to use images and <a class="zem_slink" title="Cascading Style Sheets" rel="wikipedia" href="http://en.wikipedia.org/wiki/Cascading_Style_Sheets">CSS</a> (everything else was in a database) lying at<em> a.com</em> onto <em>b.com</em> to preview the changes.</p>
<p>Let’s see what problems I faced in both the situations and how these were solved using <strong>Actionless <code>form</code></strong>. I have given similar examples, not the real situations.</p>
<h3>Case 1: URL Rewriting</h3>
<p>I was working on URL Rewriting where I had to work with hierarchical pages, something like below.</p>
<p><img class="aligncenter size-full wp-image-607" title="Page Hierarcy - How useful an Actionless form could be" src="http://amit.me/wp-content/uploads/2010/08/pagehierarcy.png" alt="Page Hierarcy - How useful an Actionless form could be" width="640" height="214" /></p>
<p>So the URLs should be:</p>
<ul>
<li>http://a.com/products/category1/product1.aspx</li>
<li>http://a.com/products/category1/product2.aspx</li>
<li>http://a.com/products/category1/product3.aspx</li>
<li>http://a.com/products/category2/product4.aspx and so on&#8230;</li>
</ul>
<p>But the actual page exists at http://a.com/products/default.aspx.</p>
<p>There are some server controls on the page as well which raise page postback. For example, you have two dropdowns – one for categories and another for products. When you choose an item from categories dropdown it raises a postback to update the products dropdown to show relevant products.</p>
<p>By default, the action attribute of <code>form </code>is set to the actual page and the path will be relative not absolute, “default.aspx” in this case.</p>
<p>So now, suppose you have opened http://a.com/products/category1/product1.aspx URL and you have picked an item from category. It will raise a postback event and look for default.aspx at http://a.com/products/category1 but its not there and the page will break. If you remove action attribute from <code>form </code>element then it will always postback to the same page and the URL rewriting rules will take care of rest of the things.</p>
<h3>Case 2: using one domain’s files on another domain/sub-domain</h3>
<p>There might be cases when we have to use images and CSS lying on another domain. There are two options to achieve this – either use <a href="http://en.wikipedia.org/wiki/Absolute_path" target="_blank">absolute path</a> or use <a href="http://www.w3schools.com/TAGS/tag_base.asp" target="_blank"><code>base</code></a><code> </code>tag. I had to opt for <code>base </code>tab because the IMAGE URLs were saved in the database with the running text (I know I could search and replace them using regex but I still opted for <code>base </code>tag).</p>
<p>Now, when I have used <code>base </code>tag, it will add a base URL to all the relative URLs and it includes the value of action attribute in form tag. Let’s name the domains, the images are at a.com and are being used on b.com. So when the postback event will be raised, it will find the action attribute file at a.com which isn’t there.</p>
<p>To overcome this situation, we can remove the action attribute so that it will always postback on the same page.</p>
<h3>Solution</h3>
<p>Unfortunately ASP.Net doesn’t give option to change or remove the value of action attribute directly. But a new form class can be implemented by inheriting System.Web.UI.HtmlControls.HtmlForm class. The implementation of Actionless form is given at <a href="http://msdn.microsoft.com/en-us/library/ms972974.aspx#urlrewriting_topic6" target="_blank">this page</a> – look for the section “Handling Postbacks”. You can also download the DLL from <a href="http://amit.me/wp-content/uploads/2010/08/ActionlessForm.zip">here</a>.</p>
<img src="http://feeds.feedburner.com/~r/amitv/~4/ZdN0Nfo9XHw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://amit.me/how-useful-an-actionless-form-could-be/606/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://amit.me/how-useful-an-actionless-form-could-be/606</feedburner:origLink></item>
		<item>
		<title>Plugin Update: Assign Categories to Pages – version 1.2</title>
		<link>http://feedproxy.google.com/~r/amitv/~3/x1uwXZUGOTM/596</link>
		<comments>http://amit.me/plugin-update-assign-categories-to-pages-version-1-2/596#comments</comments>
		<pubDate>Sun, 15 Aug 2010 12:32:44 +0000</pubDate>
		<dc:creator>Amit Verma</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[map categories to pages]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress plugins]]></category>

		<guid isPermaLink="false">http://amit.me/?p=596</guid>
		<description><![CDATA[Updates in version 1.2: Compatible with WordPress 3 Why it wasn&#8217;t working with WP3 WordPress had introduced Post Types in WP2.9. The default post types are post, page, attachment, revision, and nav-menu-item. WordPress had no restriction on applying taxonomies (category and tag) on any post type but had given the option to select for &#8220;post&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><strong>Updates in version 1.2:</strong><br />
Compatible with WordPress 3</p>
<h3>Why it wasn&#8217;t working with WP3</h3>
<p>WordPress had introduced <a href="http://codex.wordpress.org/Glossary#Post_Type" target="_blank">Post Types</a> in WP2.9. The default post types are <strong>post</strong>, <strong>page</strong>, <strong>attachment</strong>, <strong>revision</strong>, and <strong>nav-menu-item</strong>. WordPress had no restriction on applying taxonomies (category and tag) on any post type but had given the option to select for &#8220;post&#8221; post type only.</p>
<p>In WP3, the post type needs to be registered with taxonomy to be able to attached to it. The &#8220;page&#8221; post type is not registered with Category taxonomy so the plugin wasn&#8217;t able to save categories for pages in database.</p>
<h3>What have been changed to make it compatible with WP3</h3>
<p>I have used <a href="http://codex.wordpress.org/Function_Reference/register_taxonomy_for_object_type" target="_blank">register_taxonomy_for_object_type</a> function  to enable &#8220;page&#8221; post type for Categories.</p>
<img src="http://feeds.feedburner.com/~r/amitv/~4/x1uwXZUGOTM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://amit.me/plugin-update-assign-categories-to-pages-version-1-2/596/feed</wfw:commentRss>
		<slash:comments>27</slash:comments>
		<feedburner:origLink>http://amit.me/plugin-update-assign-categories-to-pages-version-1-2/596</feedburner:origLink></item>
		<item>
		<title>Plugin: Assign Categories to Pages – version 1.1</title>
		<link>http://feedproxy.google.com/~r/amitv/~3/l8OA35AK8Io/577</link>
		<comments>http://amit.me/plugin-assign-categories-to-pages-version-1-1/577#comments</comments>
		<pubDate>Mon, 12 Apr 2010 16:21:46 +0000</pubDate>
		<dc:creator>Amit Verma</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[map categories to pages]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress plugins]]></category>

		<guid isPermaLink="false">http://amit.me/?p=577</guid>
		<description><![CDATA[I have updated Map Categories to Pages. It has auto-insertion capability now. New Features in version 1.1: Option for auto-insertion of the Pages on Category pages Option for auto-insertion of Posts on the Pages which belong to the same category To enable the features, goto the Map Categories to Pages settings page. Choose the appropriate [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I have updated <a href="http://wordpress.org/extend/plugins/map-categories-to-pages/admin/" target="_blank">Map Categories to Pages</a>. It has auto-insertion capability now.</p>
<p>New Features in version 1.1:</p>
<ol>
<li>Option for auto-insertion of the Pages on Category pages</li>
<li>Option for auto-insertion of Posts on the Pages which belong to the same category</li>
</ol>
<p>To enable the features, goto the Map Categories to Pages settings page.</p>
<p style="text-align: center;"><a href="http://amit.me/wp-content/uploads/2010/04/Map-Categories-to-Pages-settings.png"><img class="aligncenter size-full wp-image-578" title="Map-Categories-to-Pages-settings" src="http://amit.me/wp-content/uploads/2010/04/Map-Categories-to-Pages-settings.png" alt="Map Categories to Pages settings page" width="594" height="171" /></a></p>
<p>Choose the appropriate option to enable the features. It also provides the option to specify Header text and style to display just before the posts list on the Pages, e.g. <code>header=Related Posts&amp;before=&lt;h3 class="title"&gt;&amp;after=&lt;/h3&gt;</code>.</p>
<ul>
<li>header &#8211; heading text just before the posts list.</li>
<li>before &#8211; Opening HTML tag (with CSS class or style) to insert just before the post titles</li>
<li>after &#8211; closing HTML tag to insert just after the post titles</li>
</ul>
<p>Read <a href="http://amit.me/assign-categories-to-pages-in-wordpress/545/">Assign Categories to Pages in WordPress</a> for more information.</p>
<img src="http://feeds.feedburner.com/~r/amitv/~4/l8OA35AK8Io" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://amit.me/plugin-assign-categories-to-pages-version-1-1/577/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		<feedburner:origLink>http://amit.me/plugin-assign-categories-to-pages-version-1-1/577</feedburner:origLink></item>
		<item>
		<title>Assign Categories to Pages in WordPress</title>
		<link>http://feedproxy.google.com/~r/amitv/~3/SwPZY_MhkDk/545</link>
		<comments>http://amit.me/assign-categories-to-pages-in-wordpress/545#comments</comments>
		<pubDate>Wed, 17 Feb 2010 04:59:29 +0000</pubDate>
		<dc:creator>Amit Verma</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[map categories to pages]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress plugins]]></category>

		<guid isPermaLink="false">http://www.amit.me/?p=545</guid>
		<description><![CDATA[WordPress has different options for organizing posts. One of them is Categories. The categories can only be assigned to posts, not to pages in WordPress. But sometime you might want to categorize the pages as well. Here are a few cases. To display related posts on a page. To display pages and categories in navigation [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><a href="http://wordpress.org" target="_blank">WordPress</a> has different options for organizing posts. One of them is <a href="http://codex.wordpress.org/Posts_Categories_SubPanel" target="_blank">Categories</a>. The categories can only be assigned to posts, not to pages in <a href="http://wordpress.org/" target="_blank">WordPress</a>. But sometime you might want to categorize the pages as well. Here are a few cases.</p>
<ol>
<li>To display related posts on a page.</li>
<li>To display pages and categories in navigation menu in mixed order. WordPress provides the two different functions to display a list of  <a href="http://codex.wordpress.org/Template_Tags/wp_list_pages" target="_blank">Pages</a> and <a href="http://codex.wordpress.org/Template_Tags/wp_list_categories" target="_blank">Categories</a>. But it doesn’t give the option to setup a navigation menu mixed with pages and categories, like the example given below. In such a case you can  map pages to categories and use them as category pages. Obviously it  will need some changes in the template.
<ul>
<li> Page 1</li>
<li> Page 2</li>
<li> Category 1</li>
<li> Page 3</li>
<li> Category 2</li>
</ul>
</li>
<li>To display pages on the category pages with the posts.</li>
</ol>
<h3>How to map Categories to pages</h3>
<p>Add following lines of code in the <em>function.php </em>of your theme directory. If you don’t have a function.php in the theme directory then you can add it using any text editor. You can also download the plugin which I have made from <a href="http://wordpress.org/extend/plugins/map-categories-to-pages/" target="_blank">http://wordpress.org/extend/plugins/map-categories-to-pages/</a>.</p>
<pre class="brush: php; title: ; notranslate">
function add_category_box_on_page(){
//add meta box
add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box', 'page', 'side', 'low');
}

add_action('admin_menu', 'add_category_box_on_page');
</pre>
<p>It will show the category selection box on the right side on &#8220;Edit Page&#8221; page.</p>
<h3 id="template-changes" name="template-changes">Template changes</h3>
<p>You will also have to edit the <a href="http://codex.wordpress.org/Pages#Page_Templates" target="_blank">page template</a> to use categories. You can use standard category code on your page template. Take a look at <a href="http://codex.wordpress.org/Function_Reference/get_the_category" target="_blank">http://codex.wordpress.org/Function_Reference/get_the_category</a> and <a href="http://codex.wordpress.org/Template_Tags/the_category" target="_blank">http://codex.wordpress.org/Template_Tags/the_category</a>.</p>
<p>Here is a small piece of code to build a page of posts. This example uses the styles from WordPress default theme.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
global $post;
$cats=array();
foreach(get_the_category() as $category) {
	$cats[]=$category-&gt;cat_ID;
}
$showposts = -1; // -1 shows all posts
$do_not_show_stickies = 1; // 0 to show stickies
$args=array(
   'category__in' =&gt; $cats,
   'showposts' =&gt; $showposts,
   'caller_get_posts' =&gt; $do_not_show_stickies
   );
$my_query = new WP_Query($args);

?&gt;

	&lt;?php if( $my_query-&gt;have_posts() ) : ?&gt;

		&lt;?php while ($my_query-&gt;have_posts()) : $my_query-&gt;the_post(); ?&gt;
			&lt;?php
			//necessary to show the tags
			global $wp_query;
			$wp_query-&gt;in_the_loop = true;
			?&gt;
			&lt;div &lt;?php post_class() ?&gt; id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;
				&lt;h2&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;
				&lt;small&gt;&lt;?php the_time('F jS, Y') ?&gt; &lt;!-- by &lt;?php the_author() ?&gt; --&gt;&lt;/small&gt;

				&lt;div class=&quot;entry&quot;&gt;
					&lt;?php the_content('Read the rest of this entry »'); ?&gt;
				&lt;/div&gt;

				&lt;p class=&quot;postmetadata&quot;&gt;&lt;?php the_tags('Tags: ', ', ', '
'); ?&gt; Posted in &lt;?php the_category(', ') ?&gt; | &lt;?php edit_post_link('Edit', '', ' | '); ?&gt;  &lt;?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?&gt;&lt;/p&gt;
			&lt;/div&gt;

		&lt;?php endwhile; ?&gt;

	&lt;?php else : ?&gt;

		&lt;h2 class=&quot;center&quot;&gt;Not Found&lt;/h2&gt;
		&lt;p class=&quot;center&quot;&gt;Sorry, but you are looking for something that isn't here.&lt;/p&gt;

	&lt;?php endif; ?&gt;
</pre>
<h3>Displaying pages on Category pages</h3>
<p>When WordPress fetches the posts from database, the default post type is &#8216;post&#8217;. So even when you have mapped a page to a category, it won&#8217;t display the page on that category page. The post type needs to be changed explicitly on the category page. To change the post type, add following code in <code>function.php</code>.</p>
<pre class="brush: php; title: ; notranslate">
//call a function just before the query runs to fetch posts
add_action('pre_get_posts','change_post_type');

function change_post_type($var) {
	if(is_category()) {
    	    	$var-&gt;query_vars['post_type'] = 'any';
            	//it will change the value to 'any' from the default value of ;post';
            	//can be any, attachment,  page, post, or revision.
            	//'any' retrieves any type except revisions.
	}
}
</pre>
<img src="http://feeds.feedburner.com/~r/amitv/~4/SwPZY_MhkDk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://amit.me/assign-categories-to-pages-in-wordpress/545/feed</wfw:commentRss>
		<slash:comments>40</slash:comments>
		<feedburner:origLink>http://amit.me/assign-categories-to-pages-in-wordpress/545</feedburner:origLink></item>
		<item>
		<title>A few posts to share from the year 2009 and 2008</title>
		<link>http://feedproxy.google.com/~r/amitv/~3/Bc3i1DR7se0/538</link>
		<comments>http://amit.me/a-few-posts-to-share-from-the-year-2009-and-2008/538#comments</comments>
		<pubDate>Sat, 26 Dec 2009 17:02:24 +0000</pubDate>
		<dc:creator>Amit Verma</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.amit.me/?p=538</guid>
		<description><![CDATA[I would like to share a few posts which I think are useful. Tip : Do more with Format Painter You can be a victim of phishing by blindly following a link in an email Access dictionary quickly from Apple applications on Mac Obscene comments on your blog can put you behind the bars Use [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I would like to share a few posts which I think are useful.</p>
<ul>
<li><a href="http://www.amit.me/tip-do-more-with-format-painter/447/">Tip : Do more with Format Painter</a></li>
<li><a href="http://www.amit.me/you-can-be-a-victim-of-phishing-by-blindly-following-a-link-in-an-email/421/">You can be a victim of phishing by blindly following a link in an email</a></li>
<li><a href="http://www.amit.me/access-dictionary-quickly-from-apple-applications-on-mac/396/">Access dictionary quickly from Apple applications on Mac</a></li>
<li><a href="http://www.amit.me/obscene-comments-on-your-blog-can-put-you-behind-the-bars/342/">Obscene comments on your blog can put you behind the bars</a></li>
<li><a href="http://www.amit.me/use-computer-in-eco-friendly-manner/326/">Use Computer in Eco-friendly manner</a></li>
<li><a href="http://www.amit.me/useful-keyboard-shortcuts-for-finder/240/">Useful keyboard shortcuts for Finder</a></li>
<li><a href="http://www.amit.me/tip-to-quickly-close-dashboard-widget/223/">Tip to quickly close dashboard widget</a></li>
</ul>
<img src="http://feeds.feedburner.com/~r/amitv/~4/Bc3i1DR7se0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://amit.me/a-few-posts-to-share-from-the-year-2009-and-2008/538/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://amit.me/a-few-posts-to-share-from-the-year-2009-and-2008/538</feedburner:origLink></item>
		<item>
		<title>Merry Christmas and Happy New Year ’09</title>
		<link>http://feedproxy.google.com/~r/amitv/~3/G6rGrukXT6s/533</link>
		<comments>http://amit.me/merry-christmas-and-happy-new-year-09/533#comments</comments>
		<pubDate>Fri, 25 Dec 2009 17:46:30 +0000</pubDate>
		<dc:creator>Amit Verma</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.amit.me/?p=533</guid>
		<description><![CDATA[Wishing all of you a very Happy New Year and Merry Christmas &#8217;09. This year was full of changes and very busy for me. I was too occupied with many projects. I couldn&#8217;t even blog after June 3rd. I will try to blog regularly in the year 2010. I am also planning to include more [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Wishing all of you a very Happy New Year and Merry Christmas &#8217;09.</p>
<div id="attachment_535" class="wp-caption aligncenter" style="width: 430px">
	<img class="size-full wp-image-535" title="xmas-new-year-09" src="http://www.amit.me/wp-content/uploads/2009/12/xmas-new-year-09.png" alt="Merry Christmas and Happy New Year '09" width="430" height="133" />
	<p class="wp-caption-text">Merry Christmas and Happy New Year &#39;09</p>
</div>
<p>This year was full of changes and very busy for me. I was too occupied with many projects. I couldn&#8217;t even blog after June 3rd.</p>
<p>I will try to blog regularly in the year 2010. I am also planning to include more topics.</p>
<p>Once again Merry Christmas, Happy New Year and Happy Blogging.</p>
<img src="http://feeds.feedburner.com/~r/amitv/~4/G6rGrukXT6s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://amit.me/merry-christmas-and-happy-new-year-09/533/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://amit.me/merry-christmas-and-happy-new-year-09/533</feedburner:origLink></item>
	</channel>
</rss>

