<?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/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>Brock Angelo &#187; WordPress</title>
	<atom:link href="http://brockangelo.com/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://brockangelo.com</link>
	<description>@gmail.com</description>
	<lastBuildDate>Fri, 22 Jul 2011 14:00:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Redirect Users Back to Page They Were On</title>
		<link>http://brockangelo.com/2009/12/17/redirect-users-back-to-page-they-were-on/</link>
		<comments>http://brockangelo.com/2009/12/17/redirect-users-back-to-page-they-were-on/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 14:09:59 +0000</pubDate>
		<dc:creator>brockangelo</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[back]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[intranet]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[redirect]]></category>

		<guid isPermaLink="false">http://brockangelo.com/?p=1312</guid>
		<description><![CDATA[How to redirect users back to the page they were on when they clicked "login".]]></description>
			<content:encoded><![CDATA[<p>I am a fan of most things WordPress, but one thing I am not a fan of is the way that everyone gets sent to the Dashboard whenever they log in. Not everyone who logs into your site will write posts or administer the site. And for an intranet, this is a drag.</p>
<p>What I&#8217;ve always wanted was a way to reload the current page after I have logged in. So if I&#8217;m on the &#8220;Search&#8221; page, I just want to go to the login page, then go back to the page I was on when I clicked the &#8220;Login&#8221; link. Finally &#8211; a solution!</p>
<p>Thanks to <a href="http://davidchambersdesign.com/wordpress-login-redirect/">David Chambers</a> &#8211; it is as easy as changing the url that the &#8220;login&#8221; link points to. </p>
<pre class="brush: php; title: ; notranslate">&lt;a href=&quot;&lt;?php echo get_option('siteurl'); ?&gt;/wp-login.php?redirect_to=&lt;?php echo urlencode($_SERVER['REQUEST_URI']); ?&gt;&quot;&gt;log in&lt;/a&gt;</pre>
<p>He calls it WordPress Login Redirect. I would imagine that this would be a handy plugin for a lot of people. On an intranet, you may want to provide a link to the dashboard if they are an admin, or a link to logout if they are not. I have been using a very simple conditional statement that determines what to put in place of the login link after you are logged in.</p>
<pre class="brush: php; title: ; notranslate">&lt;?php
	global $current_user;
	get_currentuserinfo();

	if (!(is_user_logged_in())) { ?&gt;
		&lt;a href=&quot;&lt;?php echo get_option('siteurl'); ?&gt;/wp-login.php?redirect_to=&lt;?php echo urlencode($_SERVER['REQUEST_URI']); ?&gt;&quot;&gt;Log in&lt;/a&gt;
	&lt;?php } elseif
		(
		(($current_user-&gt;user_login) == &quot;brock&quot;) 	||
		(($current_user-&gt;user_login) == &quot;admin&quot;)
		)
		{
			echo &quot;&lt;a href=\&quot;&quot;;
			echo get_option('siteurl');
			echo &quot;/wp-admin/\&quot;&gt;Dashboard&lt;/a&gt;&quot;;
			} else { ?&gt;
			&lt;a href=&quot;&lt;?php echo wp_logout_url( get_permalink() ); ?&gt;&quot; title=&quot;Logout&quot;&gt;Logout&lt;/a&gt;
			&lt;?php
		}
?&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://brockangelo.com/2009/12/17/redirect-users-back-to-page-they-were-on/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Replace Text on Click Using JavaScript</title>
		<link>http://brockangelo.com/2009/06/19/replace-text-on-click-using-javascript/</link>
		<comments>http://brockangelo.com/2009/06/19/replace-text-on-click-using-javascript/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 18:12:19 +0000</pubDate>
		<dc:creator>brockangelo</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[replace]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://brockangelo.com/?p=955</guid>
		<description><![CDATA[Did you know that you can replace text using Javascript? I wrote this script for our company intranet. In our staff phone directory I show the internal 5-digit phone number by default. Clicking the number reveals a 7-digit external phone number. Try the demo.]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript" src="/wp-content/themes/downtown-java-3column.js"></script><br />
<script type="text/javascript">
function toggle_text(shown, hidden) {
       var e = document.getElementById(shown);
       var f = document.getElementById(hidden);
    if(e.style.display == 'inline') {
			e.style.display = 'none';
			f.style.display = 'inline';
	}
	else {
			e.style.display = 'inline';
			f.style.display = 'none';
	}
}
</script><br />
This tutorial will show you how to replace text with text by using JavaScript. The text that you click will be replaced with new text. Specifically, we will use JavaScript to hide one div and show another in it&#8217;s place. Here is a demo:</p>
<blockquote><p><center><br />
<h2>
<div id="shown_first" style="display:inline"><a style="cursor:pointer" onclick="toggle_text('shown_first', 'hidden_first')">Click me	</a></div>
<div id="hidden_first" style="display:none"><a style="cursor:pointer" onclick="toggle_text('shown_first', 'hidden_first')">I used to be hidden!</a></div>
</h2>
<p></center></p></blockquote>
<p>JavaScript does the magic behind the scenes. The way you accomplish this is by putting your two text fields into divs. I&#8217;ll set the first one to be visible, then when you click on it, I will hide the first and show the second in its place. I use the <code>style.display</code> feature of JavaScript to change whether or not it is visible or shown. Let&#8217;s take a look at the JavaScript:</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;

function toggle_text(shown, hidden) {
       var e = document.getElementById(shown);
       var f = document.getElementById(hidden);
    if(e.style.display == 'inline') {
			e.style.display = 'none';
			f.style.display = 'inline';
	}
	else {
			e.style.display = 'inline';
			f.style.display = 'none';
	}
}
&lt;/script&gt;
</pre>
<p>I&#8217;m simply passing in the two divs to the JavaScript function, then JavaScript checks whether or not the first div (the <code>shown</code> div) is visible or not. If it is visible, it hides it and shows the hidden one. The opposite happens if it isn&#8217;t visible. Note that using <code>inline</code> will display your text on the same line. If we wanted it to be on its own line, we could just use <code>block</code> instead.</p>
<p>Now you just need to insert the divs into the body of the page. Here is the code used from the sample above:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;shown_first&quot; style=&quot;display:inline&quot;&gt;
	&lt;a style=&quot;cursor:pointer&quot; onclick=&quot;toggle_text('shown_first', 'hidden_first')&quot;&gt;
	Click me
	&lt;/a&gt;
&lt;/div&gt;
&lt;div id=&quot;hidden_first&quot; style=&quot;display:none&quot;&gt;
	&lt;a style=&quot;cursor:pointer&quot; onclick=&quot;toggle_text('shown_first', 'hidden_first')&quot;&gt;
	I used to be hidden!
	&lt;/a&gt;
&lt;/div&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://brockangelo.com/2009/06/19/replace-text-on-click-using-javascript/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Delete Comment Spam using a Cron Job</title>
		<link>http://brockangelo.com/2009/05/23/delete-comment-spam-using-a-cron-job/</link>
		<comments>http://brockangelo.com/2009/05/23/delete-comment-spam-using-a-cron-job/#comments</comments>
		<pubDate>Sat, 23 May 2009 17:46:12 +0000</pubDate>
		<dc:creator>brockangelo</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[akismet]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[delete-spam-daily]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://brockangelo.com/?p=751</guid>
		<description><![CDATA[Delete all the comments marked as spam automatically using cron.]]></description>
			<content:encoded><![CDATA[<p><strong>Delete Comment Spam using a Cron Job</strong></p>
<p>WordPress catches all of the comment spam, but it doesn&#8217;t seem to delete it often enough. If you have a high traffic site, this can become megabytes in your database. Bleh. I don&#8217;t have a high traffic site, but I sync my databases off-site everyday and spam wastes my bandwidth. So I delete all the comments marked as spam automatically each day using a scheduled cron job so that I never even have to see it. Could I possibly delete a real comment? Yes. Does the convenience of never even knowing about comment spam outweigh the risk? You bet.</p>
<p>Create a bash script in your scripts folder by typing this at the command prompt:</p>
<blockquote><p><code>sudo pico /home/brockangelo/scripts/del_spam.sh</code></p></blockquote>
<blockquote><p><strong>sudo:</strong>  elevate privileges<br />
<strong>pico:</strong>   use your editor of choice<br />
<strong>/home&#8230;/scripts/:</strong>   wherever you keep all your bash scripts<br />
<strong>del_spam.sh:  </strong>name it something obvious</p></blockquote>
<p>By the way, bash scripts are as easily made as windows batch files. You just put in the code and put a .sh at the end. Inside &#8220;del_spam.sh&#8221; add the following:</p>
<blockquote><p><code>mysql -u username -ppassword -e "delete from wp_comments where comment_approved='spam';" brockangelo</code></p></blockquote>
<p>Where &#8220;brockangelo&#8221; is the name of the database. Repeat this line for each WordPress site you host. Then you need to set this up as a cron job and schedule it for once a night. Or, you can download my plugin that deletes spam daily. <a href="http://brockangelo.com/wordpress/plugins/delete-spam-daily/">Delete Spam Daily</a> plugin.</p>
<p>By the way, the username and password format in that command you see above looks wrong, but it is typed correctly. You put &#8220;-u (space) username&#8221; then you squish the &#8220;-p&#8221; and &#8220;password&#8221; together like this &#8220;-u username -ppassword&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://brockangelo.com/2009/05/23/delete-comment-spam-using-a-cron-job/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Add Uploaded Media to WP-DownloadManager</title>
		<link>http://brockangelo.com/2009/05/12/how-to-add-uploaded-media-to-wp-downloadmanager/</link>
		<comments>http://brockangelo.com/2009/05/12/how-to-add-uploaded-media-to-wp-downloadmanager/#comments</comments>
		<pubDate>Tue, 12 May 2009 19:22:11 +0000</pubDate>
		<dc:creator>brockangelo</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[custom field]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[wp-downloadcounter]]></category>
		<category><![CDATA[wp-downloadmanager]]></category>

		<guid isPermaLink="false">http://brockangelo.com/?p=740</guid>
		<description><![CDATA[<p>WARNING: All of the recommendations in this post work off of a test database. The following commands could damage your live site if not tested first. Always work off a test site, then perform a database backup before doing any of these things.</p> <p>I was faced with a challenge at work this week: I wanted [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><strong>WARNING: All of the recommendations in this post work off of a test database. The following commands could damage your live site if not tested first. Always work off a test site, then perform a database backup before doing any of these things.</strong></p></blockquote>
<p>I was faced with a challenge at work this week: I wanted to track how many downloads our forms were getting on the company intranet (built on WordPress). I had already uploaded over one thousand forms to the site. I needed an upload tool that would be able to look at all of the forms and other media that we have accumulated. Unfortunately, none of the download counter plugins for WordPress will look add existing media, and they all want you to upload your forms (or media) through their &#8220;Add download&#8221; button.</p>
<p>Well, if I&#8217;d uploaded only a couple of forms, this wouldn&#8217;t be a problem. But since I was dealing with one thousand, I needed a way to import <em>existing</em> uploads into the new download counter. This would have to be done in MySQL. </p>
<p>I looked at download counters on wordpress.org and found one that I liked: <a href="http://wordpress.org/extend/plugins/wp-downloadmanager/" target="_blank">WP-DownloadManager</a>. There seem to be quite a few of them, including <a href="http://wordpress.org/extend/plugins/wp-downloadcounter/">WP-DownloadCounter</a> (which I also liked) but I chose this one simply because it had been around longer and had a very high rating.</p>
<p>WP-DownloadManager has a way to import existing forms from the management page, but they have to be done one at a time, and you have to manually type all of your titles over again. This would take way too long. So I came up with a way to migrate all of my uploaded form titles and filenames to the WP-DownloadManager&#8217;s database. </p>
]]></content:encoded>
			<wfw:commentRss>http://brockangelo.com/2009/05/12/how-to-add-uploaded-media-to-wp-downloadmanager/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Search and Replace a Custom Field in WordPress using PHPMyAdmin</title>
		<link>http://brockangelo.com/2009/03/18/search-and-replace-a-custom-field-in-wordpress-using-phpmyadmin/</link>
		<comments>http://brockangelo.com/2009/03/18/search-and-replace-a-custom-field-in-wordpress-using-phpmyadmin/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 11:32:07 +0000</pubDate>
		<dc:creator>brockangelo</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[custom fields]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[phpmyadmin]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://brockangelo.com/?p=706</guid>
		<description><![CDATA[Here is how to do a search and replace for a specific Custom Field value in WordPress. Works for all posts that have that value in a specific Custom Field.]]></description>
			<content:encoded><![CDATA[<p><strong>Search and Replace a Custom Field in WordPress using PHPMyAdmin</strong></p>
<p>If you&#8217;ve ever used Microsoft Excel, you probably have an idea of just how easy changing hundreds of cells can be. Gone are the days of manually typing line by line any corrections that you need to make. The same is true when you are working with a database like we are in WordPress. </p>
<p>This example performs a search and replace of all custom fields that meet a specified criteria. In this case, I&#8217;m looking for all staff member pages that have a custom field for a department phone number that was incorrect. We want to replace that with a new number. Using PHPMyAdmin and running a SQL query, I can select all of them to see the results before I do anything to my databse:</p>
<blockquote><p><code>SELECT * FROM `wp_postmeta` WHERE `meta_key` LIKE 'DeptPhone' AND `meta_value` LIKE '212-555-1212'</code></p></blockquote>
<p>It is worth mentioning, that you can also use wildcards if you want to include more results. The &#8216;%&#8217; is your wildcard:</p>
<blockquote><p><code>SELECT * FROM `wp_postmeta` WHERE `meta_key` LIKE '%eptPhone' AND `meta_value` LIKE '212-555-%'</code></p></blockquote>
<p>This yields the same results. It is also worth pointing out that the quotation mark around our text values and the tick mark around our table column names are different.</p>
<blockquote><ul>
<li><code>`meta_key`</code> 	uses tick marks	(this is usally the top left key on your keyboard, next to the 1)</li>
<li><code>'%DeptPhone'</code> 	uses a single quotation mark (this is next to the enter key)</li>
</ul>
</blockquote>
<p>So, to perform the changes, we need to use the UPDATE command instead of select, and actually replace text. Here goes:</p>
<blockquote><p><code>UPDATE `wp_postmeta` SET `meta_value` = replace(meta_value, '212-555-1212', '212-444-1212') WHERE `meta_key` LIKE 'DeptPhone'<br />
</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://brockangelo.com/2009/03/18/search-and-replace-a-custom-field-in-wordpress-using-phpmyadmin/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Search and Replace MySQL using PHPMyAdmin</title>
		<link>http://brockangelo.com/2008/11/09/search-and-replace-mysql-using-phpmyadmin/</link>
		<comments>http://brockangelo.com/2008/11/09/search-and-replace-mysql-using-phpmyadmin/#comments</comments>
		<pubDate>Sun, 09 Nov 2008 19:51:17 +0000</pubDate>
		<dc:creator>brockangelo</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[phpmyadmin]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[search and replace]]></category>

		<guid isPermaLink="false">http://brockangelo.com/?p=689</guid>
		<description><![CDATA[<p>Search and Replace MySQL using PHPMyAdmin</p> <p>This is a life-saver: an easy way to search any table inside your database and replace one string of text with another. It works like a charm. But be careful, search first to see the results of your query before you commit the changes, and always backup prior to [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Search and Replace MySQL using PHPMyAdmin</strong></p>
<p>This is a life-saver: an easy way to search any table inside your database and replace one string of text with another. It works like a charm. But be careful, search first to see the results of your query before you commit the changes, and always backup prior to any database work.</p>
<p>Here is how you test the waters safely:</p>
<blockquote><p><code>SELECT * FROM `wp_posts` WHERE `post_content` LIKE '%oops%'</code></p></blockquote>
<p>Translation:</p>
<blockquote><p><code>SELECT * FROM `table_name` WHERE `field_name` LIKE '%unwanted_text%'</code></p></blockquote>
<p>And here is how you do some damage:</p>
<blockquote><p><code>UPDATE `wp_posts` SET `post_content` = replace(post_content, 'oops', 'much better')</code></p></blockquote>
<p>And translated:</p>
<blockquote><p><code>UPDATE `table_name` SET `field_name` = replace(same_field_name, 'unwanted_text', 'wanted_text')</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://brockangelo.com/2008/11/09/search-and-replace-mysql-using-phpmyadmin/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to Change Attributes for all Files and Folders</title>
		<link>http://brockangelo.com/2008/11/02/how-to-change-attributes-for-all-files-and-folders/</link>
		<comments>http://brockangelo.com/2008/11/02/how-to-change-attributes-for-all-files-and-folders/#comments</comments>
		<pubDate>Sun, 02 Nov 2008 19:56:44 +0000</pubDate>
		<dc:creator>brockangelo</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://brockangelo.com/?p=671</guid>
		<description><![CDATA[<p>How to Change Attributes for all Files and Folders in Linux</p> <p>I am regularly working with WordPress and need to change the attributes of my files and folders so that it is locked down and secure. This is a two step process. I first change the attributes of all files to 644. Then I change [...]]]></description>
			<content:encoded><![CDATA[<p><strong>How to Change Attributes for all Files and Folders in Linux</strong></p>
<p>I am regularly working with WordPress and need to change the attributes of my files and folders so that it is locked down and secure. This is a two step process. I first change the attributes of all files to 644. Then I change the attributes of all folders to 755. However, you should decide what is best for you by reading the article on the Codex called <a href="http://codex.wordpress.org/Changing_File_Permissions">Changing File Permissions</a> if you are new to this topic.</p>
<p>This can be done from anywhere, since I always type out the full path to the location so I know I&#8217;m not making any mistakes. I enter the following to change all files:</p>
<blockquote><p><code>sudo find [enter path here. ex: /var/www/wordpress] -type f -exec chmod 644 {} \;</code></p></blockquote>
<p>And I follow that up by entering the following for folders:</p>
<blockquote><p><code>sudo find [enter path here. ex: /var/www/wordpress] -type d -exec chmod 755 {} \;</code></p></blockquote>
<p>And you&#8217;re done. </p>
]]></content:encoded>
			<wfw:commentRss>http://brockangelo.com/2008/11/02/how-to-change-attributes-for-all-files-and-folders/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Removing Categories from your RSS feed</title>
		<link>http://brockangelo.com/2008/09/21/removing-categories-from-your-rss-feed/</link>
		<comments>http://brockangelo.com/2008/09/21/removing-categories-from-your-rss-feed/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 00:47:04 +0000</pubDate>
		<dc:creator>brockangelo</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://brockangelo.com/?p=154</guid>
		<description><![CDATA[<p>Removing Categories from your RSS feed: <br />It&#8217;s pretty straightforward. Just go into your feed files and add a filter saying: &#8220;if the post is in one of these categories, don&#8217;t include it in the feed&#8221;. Well, that&#8217;s the basic concept. Here are the details:I edited the /wp-includes/feed-rss.php &#38; /wp-includes/feed-rss2.php You probably should also do [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Removing Categories from your RSS feed</strong>: <br />It&#8217;s pretty straightforward. Just go into your feed files and add a filter saying: &#8220;if the post is in one of these categories, don&#8217;t include it in the feed&#8221;. Well, that&#8217;s the basic concept. Here are the details:I edited the <code>/wp-includes/feed-rss.php</code> &amp; <code>/wp-includes/feed-rss2.php</code> You probably should also do the atomfeeds and others found inside wp-includes, but everyone who is subscribed to our blog uses Google Reader, and afaik, Google uses RSS, so I didn&#8217;t bother. I added the following lines just after the beginning of the loop and right after the </p>
<pre class="brush: php; title: ; notranslate">while have_posts : the_post:</pre>
<p>Add this php code:</p>
<pre class="brush: php; title: ; notranslate">if ((!(in_category(53))) &amp;amp;&amp;amp; (!(in_category(55))) &amp;amp;&amp;amp; (!(in_category(56)))) : {
</pre>
<p>Where 53, 55 &#038; 56 are categories that you don&#8217;t want in your feed. Notice that this is an <em>if</em> statement and this ends with an <em>opening</em> curly brace. So all you have to do is close this if statement.</p>
<p>You must close the if statement at the bottom of the file by issuing a <em>closing</em> curly brace and an <code>endif</code> statement just before the <code>endwhile</code>. So the bottom of my &#8220;feed-rss.php&#8221; looks like this:</p>
<pre class="brush: php; title: ; notranslate">
&amp;lt;?php while (have_posts()) : the_post(); ?&amp;gt;
&amp;lt;?php if ((!(in_category(53))) &amp;amp;&amp;amp; (!(in_category(55))) &amp;amp;&amp;amp; (!(in_category(56)))) : { ?&amp;gt;
&amp;lt;item&amp;gt;
&amp;lt;title&amp;gt;&amp;lt;?php the_title_rss() ?&amp;gt;&amp;lt;/title&amp;gt;
&amp;lt;?php if (get_option('rss_use_excerpt')) { ?&amp;gt;
&amp;lt;description&amp;gt;&amp;lt;![CDATA[&amp;lt;?php the_excerpt_rss() ?&amp;gt;]]&amp;gt;&amp;lt;/description&amp;gt;
&amp;lt;?php } else { // use content ?&amp;gt;
&amp;lt;description&amp;gt;&amp;lt;?php the_content_rss(”, 0, ”, get_option(’rss_excerpt_length’)) ?&amp;gt;&amp;lt;/description&amp;gt;
&amp;lt;?php } ?&amp;gt;
&amp;lt;link&amp;gt;&amp;lt;?php permalink_single_rss() ?&amp;gt;&amp;lt;/link&amp;gt;
&amp;lt;?php do_action(’rss_item’); ?&amp;gt;
&amp;lt;/item&amp;gt;
&amp;lt;?php } endif; ?&amp;gt;
&amp;lt;?php endwhile; ?&amp;gt;
&amp;lt;/channel&amp;gt;
&amp;lt;/rss&amp;gt;
</pre>
<p>The Codex article can be found here: <a href="http://codex.wordpress.org/Customizing_Feeds">Customizing Feeds</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://brockangelo.com/2008/09/21/removing-categories-from-your-rss-feed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aligning Navbar to both Left and Right</title>
		<link>http://brockangelo.com/2008/09/10/aligning-navbar-to-both-left-and-right/</link>
		<comments>http://brockangelo.com/2008/09/10/aligning-navbar-to-both-left-and-right/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 21:07:08 +0000</pubDate>
		<dc:creator>brockangelo</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[navbar]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tables]]></category>

		<guid isPermaLink="false">http://brockangelo.com/?p=239</guid>
		<description><![CDATA[<p>Aligning a Navigation Bar to both the Left side and the Right sides:</p> <p>I have always thought it would be nice to have a navigation bar that aligns text to both the left and the right, so I finally took the time to get this working. Once I figured it out, it was very simple [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Aligning a Navigation Bar to both the Left side and the Right sides</strong>:</p>
<p>I have always thought it would be nice to have a navigation bar that aligns text to both the left and the right, so I finally took the time to get this working. Once I figured it out, it was very simple to setup. </p>
<p>So on the left you&#8217;ll have this:<br />
<center><br />
<blockquote><img src="http://brockangelo.com/wp-content/uploads/2008/09/left.jpg" alt="" title="left" width="366" height="54" class="aligncenter size-full wp-image-242" /></p></blockquote>
<p></center></p>
<p>And on the right you&#8217;ll have this:<br />
<center><br />
<blockquote><img src="http://brockangelo.com/wp-content/uploads/2008/09/right.jpg" alt="" title="right" width="281" height="66" class="aligncenter size-full wp-image-241" /></p></blockquote>
<p></center></p>
<p>It is as simple as an html table. Yep. Just think about it. Your navigation bar is a single row, with two columns. I set my left column to 70% and my right column to 30%. Then I can align each table to the left or right. </p>
<p>I set the entire table inside an unordered list, then each page link is just an <code>li</code> or a <em>list item</em>. Your header.php file will probably look similar to mine, but without the table. What you choose to do with your newly-balanced right side is up to you. I am displaying the current time with a greeting depending on the time of day. At my office we are displaying the visitors IP address (very handy on a LAN).</p>
<pre class="brush: php; title: ; notranslate">
&lt;div id=&quot;navbar&quot;&gt;
	&lt;ul&gt;
		&lt;table width=&quot;100%&quot;&gt;
			&lt;tr&gt;
		&lt;td width=&quot;80%&quot;&gt;&lt;li&gt;&lt;a href=&quot;&lt;?php echo get_settings('home'); ?&gt;&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
		&lt;?php wp_list_pages(); ?&gt;
		&lt;?php wp_list_categories(); ?&gt;
		&lt;/td&gt;
		&lt;td width=&quot;20%&quot; align=&quot;right&quot;&gt;&lt;div id=&quot;txt&quot;&gt;&lt;/div&gt;&lt;/td&gt;
			&lt;/tr&gt;
		&lt;/table&gt;
	&lt;/ul&gt;
&lt;/div&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://brockangelo.com/2008/09/10/aligning-navbar-to-both-left-and-right/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using PHP code in Posts &amp; Pages</title>
		<link>http://brockangelo.com/2008/09/06/using-php-code-in-posts-pages/</link>
		<comments>http://brockangelo.com/2008/09/06/using-php-code-in-posts-pages/#comments</comments>
		<pubDate>Sun, 07 Sep 2008 00:03:12 +0000</pubDate>
		<dc:creator>brockangelo</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[exec-php]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wp-syntax]]></category>

		<guid isPermaLink="false">http://brockangelo.com/?p=134</guid>
		<description><![CDATA[<p>There really is no other way around it: you need to be able to add php code to Posts &#038; Pages if you are going to mod your WP install. I use so much PHP &#038; custom SQL queries on the company intranet that WordPress is almost an aside to the main event.</p> <p>But in [...]]]></description>
			<content:encoded><![CDATA[<p>There really is no other way around it: you need to be able to add php code to Posts &#038; Pages if you are going to mod your WP install. I use so much PHP &#038; custom SQL queries on the company intranet that WordPress is almost an aside to the main event.</p>
<p>But in order to use PHP code inside posts, pages &amp; widgets, you need to get the <a href="http://bluesome.net/post/2005/08/18/50/">Exec-PHP plugin</a>. It is truly amazing. Once it is installed, just turn off your Rich Text Editor and start coding away. But what do you do when you want to <em>display PHP code</em> inside of one of your posts? There are times that you&#8217;ll want to show off your PHP code without executing it. That can be done too. Taken from the exec-php homepage:<br />
<em>If you just want to print out code and don’t want to execute it, e.g. like it is done here on this page, you have to make sure to convert your code to the correct XHTML representation.<br />
</em></p>
<blockquote><p><center></p>
<table>
<tr>
<td width="33%">
<h4>&lt;</h4>
</td>
<td width="33%">type</td>
<td width="33%">
<h4><code>&amp;lt;</code></h4>
</td>
</tr>
<tr>
<td width="33%">
<h4>&gt;</h4>
</td>
<td width="33%">type</td>
<td width="33%">
<h4><code>&amp;gt;</code></h4>
</td>
</tr>
<tr>
<td width="33%">
<h4>&amp;</h4>
</td>
<td width="33%">type</td>
<td width="33%">
<h4><code>&amp;amp;</code></h4>
</td>
</tr>
</table>
<p></center></p></blockquote>
<p>This is, however, very tedious if you think you&#8217;ll put PHP in your code more than once. You can do this conversion much more intelligently by using the <a href="http://wordpress.org/extend/plugins/wp-syntax/">WP-Syntax</a> plugin. It creates nice colorful code boxes and formats them to any code format (PHP, Java, HTML, C+, Ruby, etc). It looks like this:</p>
<pre class="brush: php; title: ; notranslate">
&amp;lt;div id=&amp;quot;navbar&amp;quot;&amp;gt;
	&amp;lt;ul&amp;gt;	&amp;lt;table width=&amp;quot;100%&amp;quot;&amp;gt;
			&amp;lt;tr&amp;gt;
		&amp;lt;td width=&amp;quot;80%&amp;quot;&amp;gt;&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;&amp;lt;?php echo get_settings('home'); ?&amp;gt;&amp;quot;&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
		&amp;lt;?php wp_list_pages('title_li=&amp;amp;depth=1&amp;amp;include=38'); ?&amp;gt;
		&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;http://brockangelo.com/category/ubuntu/&amp;quot;&amp;gt;Ubuntu&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
		&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;http://brockangelo.com/category/wordpress/&amp;quot;&amp;gt;WordPress&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
		&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;&amp;lt;?php bloginfo('rss2_url'); ?&amp;gt;&amp;quot;&amp;gt;RSS&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/td&amp;gt;
		&amp;lt;td width=&amp;quot;20%&amp;quot; align=&amp;quot;right&amp;quot;&amp;gt;&amp;lt;li&amp;gt;&amp;lt;a&amp;gt;&amp;lt;?php echo (date(&amp;quot;g:i a&amp;quot;)); ?&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/td&amp;gt;
			&amp;lt;/tr&amp;gt;
		&amp;lt;/table&amp;gt;
	&amp;lt;/ul&amp;gt;
&amp;lt;/div&amp;gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://brockangelo.com/2008/09/06/using-php-code-in-posts-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

