<?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>Bruno Fernandes Portfolio</title> <atom:link href="http://www.brunofernandes.com/feed/" rel="self" type="application/rss+xml" /><link>http://www.brunofernandes.com</link> <description>Just another WordPress weblog</description> <lastBuildDate>Tue, 31 Jan 2012 16:29:17 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=</generator> <item><title>How to exclude categories from homepage, feeds and archives of your wordpress website</title><link>http://www.brunofernandes.com/how-to-exclude-categories-from-homepage-feeds-and-archives-of-your-wordpress-website/</link> <comments>http://www.brunofernandes.com/how-to-exclude-categories-from-homepage-feeds-and-archives-of-your-wordpress-website/#comments</comments> <pubDate>Sat, 03 Apr 2010 16:55:03 +0000</pubDate> <dc:creator>Bruno Fernandes</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[Coding]]></category> <guid
isPermaLink="false">http://www.brunofernandes.com/?p=67</guid> <description><![CDATA[During the development of a project using wordpress, i had the need to exclude some categories from the homepage blog, from the archives and from the feeds pages of my wordpress website. During my research to find out a solution, i found several codes but any of them was exactly what i wanted and some [...]]]></description> <content:encoded><![CDATA[<p>During the development of a project using wordpress, i had the need to <strong>exclude</strong> some <strong>categories from the homepage blog, from the archives and from the feeds pages of my wordpress website</strong>. During my research to find out a solution, i found several codes but any of them was exactly what i wanted and some of them not even worked. As i had some troubles to solve this problem i decided to share the code, that after all is really simple.</p><p>In this post i will explain how to <strong>exclude</strong> categories from your <strong>homepage</strong>(the homepage is the page where the blog is showed first &#8211; in some cases your homepage can be another page), <strong>archives and feeds pages.</strong></p><p><strong>You can find bellow the code that you need.</strong></p><p><strong>Copy</strong> the code bellow and go to your theme <strong>functions.php file</strong> &#8211; you can find it in your <strong>theme folder</strong> and edit it directly or you can use your admin panel and go into <strong>Appearance &gt; Editor</strong>, and open <strong>functions.php</strong> &#8211; and <strong>paste </strong>de code in this file somewhere, can be in the top or in the end of the file, its not important.</p><p>Now you must know which categories you want to exclude from homepage, archives and feeds pages. To do it go to your wordpress admin panel, go to <strong>Post &gt; Categories</strong> and put the <strong>mouse hover the category that you want to exclude</strong>, in the bottom left corner of your browser should appear a URL and in the end of the URL you can find something like this &#8211; &#8220;<strong>&amp;cat_ID=X&#8221; </strong>-<strong> </strong> X is the <strong>ID</strong> of the category.</p><p>If you cant find the <strong>ID</strong> using the method above you can click in the category and in the URL of the next page the same thing will appear <strong>at the end of the URL.</strong></p><p>Now just <strong>a</strong><strong>dd the categories to the function</strong> and its DONE! Now go to your website a see if works. If you have any problem just leave a comment and <strong>maybe i can help you.</strong></p><pre><code> add_action('pre_get_posts', 'exclude_categories_' ); function exclude_categories_($toExclude) { global $wp_query; // Use this variable to assign the categories to exclude $categoriesExclude = '-3 -10 -11'; //this is jus an example. Change the ids to fit your needs // this example will exclude the categories assigned to the $categoriesExclude variable //from homepage, archives pages, feeds but not from categories pages if( is_home() || is_feed() ||( is_archive() &amp;&amp; !is_category() )) { $wp_query-&gt;query_vars['cat'] = $categoriesExclude; } } </code></pre><p>You can change the code as you want to feet your needs,<strong> for example if you just want to exclude from feeds page you can use the code bellow:</strong></p><pre><code> add_action('pre_get_posts', 'exclude_categories_' ); function exclude_categories_($toExclude) { global $wp_query; // Use this variable to assign the categories to exclude $categoriesExclude = '-3 -10 -11'; //this is jus an example. Change the ids to fit your needs //you can use one or more categories to exclude just use the same structure // this example will exclude the categories assigned to the $categoriesExclude variable //from feeds page if(is_feed()) { $wp_query-&gt;query_vars['cat'] = $categoriesExclude; } } </code></pre><img
src="http://www.brunofernandes.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=67" width="1" height="1" style="display: none;" />]]></content:encoded> <wfw:commentRss>http://www.brunofernandes.com/how-to-exclude-categories-from-homepage-feeds-and-archives-of-your-wordpress-website/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Best of 3D &#8211; Autodesk Design Visualization Showreel 2009</title><link>http://www.brunofernandes.com/best-of-3d-autodesk-design-visualization-showreel-2009/</link> <comments>http://www.brunofernandes.com/best-of-3d-autodesk-design-visualization-showreel-2009/#comments</comments> <pubDate>Thu, 11 Mar 2010 05:20:59 +0000</pubDate> <dc:creator>Bruno Fernandes</dc:creator> <category><![CDATA[Random]]></category> <guid
isPermaLink="false">http://www.brunofernandes.com/?p=42</guid> <description><![CDATA[]]></description> <content:encoded><![CDATA[<p><object
classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param
name="allowFullScreen" value="true" /><param
name="allowscriptaccess" value="always" /><param
name="wmode" value="transparent" /><param
name="src" value="http://www.youtube.com/v/6vOtaUB88XI&amp;hl=pt_PT&amp;fs=1&amp;" /><param
name="allowfullscreen" value="true" /><embed
type="application/x-shockwave-flash" width="520" height="320" wmode="transparent" src="http://www.youtube.com/v/6vOtaUB88XI&amp;hl=pt_PT&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p> <img
src="http://www.brunofernandes.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=42" width="1" height="1" style="display: none;" />]]></content:encoded> <wfw:commentRss>http://www.brunofernandes.com/best-of-3d-autodesk-design-visualization-showreel-2009/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Finally my website is online!</title><link>http://www.brunofernandes.com/finally-my-website-is-online/</link> <comments>http://www.brunofernandes.com/finally-my-website-is-online/#comments</comments> <pubDate>Wed, 17 Feb 2010 04:22:18 +0000</pubDate> <dc:creator>Bruno Fernandes</dc:creator> <category><![CDATA[Random]]></category> <guid
isPermaLink="false">http://www.brunofernandes.com/?p=18</guid> <description><![CDATA[It’s finally arrived&#8230;my own site! After lots of time with no time to finish my website, because i was busy working on other people’s projects and finishing my studies. &#60;!&#8211;more&#8211;&#62;But I’m glad to say I finally had some time to work on it. It’s not complete yet but it’s a good start. I hope you [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://www.brunofernandes.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2JydW5vZmVybmFuZGVzLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxMC8wMi9icnVub2Zlcm5hbmRlcy13ZWItZGVzaWduLnBuZw=="><img
class="alignleft size-medium wp-image-19" title="brunofernandes-web-design" src="http://brunofernandes.com/wp-content/uploads/2010/02/brunofernandes-web-design-300x144.png" alt="brunofernandes.com webdesign" width="300" height="144" /></a></p><p>It’s finally arrived&#8230;my own site! After lots of time with no time to finish my website, because i was busy working on other people’s projects and finishing my studies. &lt;!&#8211;more&#8211;&gt;But I’m glad to say I finally had some time to work on it. It’s not complete yet but it’s a good start.</p><p>I hope you like it! <img
src='http://www.brunofernandes.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> <img
src="http://www.brunofernandes.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=18" width="1" height="1" style="display: none;" />]]></content:encoded> <wfw:commentRss>http://www.brunofernandes.com/finally-my-website-is-online/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
