<?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"
	>

<channel>
	<title>Henrie Media Inc &#187; Web Applications</title>
	<atom:link href="http://www.henriemedia.com/view/technical-support/web-applications/feed/rss2/" rel="self" type="application/rss+xml" />
	<link>http://www.henriemedia.com</link>
	<description>Henrie Media Inc. specializes in providing innovative marketing solutions and services to our customers.</description>
	<pubDate>Mon, 03 Nov 2008 21:05:23 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>Exclude Category from the main page or RSS feed in Wordpress</title>
		<link>http://www.henriemedia.com/technical-support/exclude-category-from-the-main-page-or-rss-feed-in-wordpress/</link>
		<comments>http://www.henriemedia.com/technical-support/exclude-category-from-the-main-page-or-rss-feed-in-wordpress/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 22:17:12 +0000</pubDate>
		<dc:creator>Henrie Media Inc.</dc:creator>
		
		<category><![CDATA[Technical Support]]></category>

		<category><![CDATA[Web Applications]]></category>

		<guid isPermaLink="false">http://www.henriemedia.com/?p=72</guid>
		<description><![CDATA[Have you ever wanted to exclude a category from the main page or the RSS feed of your Wordpress blog? This is the easiest way I have found to do this, without installing a plug-in.
Put the following code anywhere in your theme&#8217;s template functions.php file. For example, if your theme is called &#8220;travel&#8221; then you [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever wanted to exclude a category from the main page or the RSS feed of your Wordpress blog? This is the easiest way I have found to do this, without installing a plug-in.</p>
<p>Put the following code anywhere in your theme&#8217;s template functions.php file. For example, if your theme is called &#8220;travel&#8221; then you would probably find this file here - wp-content/themes/travel/functions.php. If for some reason this file doe not exisit, just create it and save it in your theme&#8217;s folder.</p>
<p>Copy and paste the following into the functions.php file -</p>
<p>function exclude_category($query) {<br />
if ( $query-&gt;is_feed || $query-&gt;is_home ) {<br />
$query-&gt;set(&#8217;cat&#8217;, &#8216;-1&#8242;);<br />
}<br />
return $query;<br />
}<br />
add_filter(&#8217;pre_get_posts&#8217;, &#8216;exclude_category&#8217;);</p>
<p>The code above excludes the category with the id of &#8220;1&#8243; from both the RSS feed and from the main page of your blog. If you want to exclude multiple categories, simply add a comma ( , ) and a dash ( - ) followed by the category ID. For example: &#8216;-2, -3, -4&#8242;. You can locate the category id by logging into the Wordpress dashboard, clicking on manage, then categories.</p>
<p>If you just want to exclude a category from the main page and not the RSS feed, simply replace &#8220;( $query-&gt;is_feed || $query-&gt;is_home )&#8221; with &#8220;( $query-&gt;$query-&gt;is_home )&#8221; or to remove it from just the RSS feed &#8220;( $query-&gt;is_feed)&#8221;.</p>
<p>That&#8217;s all there is to it! Happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.henriemedia.com/technical-support/exclude-category-from-the-main-page-or-rss-feed-in-wordpress/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dynamic Meta Code for Wordpress</title>
		<link>http://www.henriemedia.com/technical-support/dynamic-meta-code-for-wordpress/</link>
		<comments>http://www.henriemedia.com/technical-support/dynamic-meta-code-for-wordpress/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 20:51:00 +0000</pubDate>
		<dc:creator>Henrie Media Inc.</dc:creator>
		
		<category><![CDATA[Technical Support]]></category>

		<category><![CDATA[Web Applications]]></category>

		<guid isPermaLink="false">http://www.henriemedia.com/?p=64</guid>
		<description><![CDATA[So I have wanted to have dynamically generated META Code (title, description, keywords) for my Wordpress blog for sometime now. I tried all of the plug-ins and frankly, they just didn&#8217;t get me where I wanted to go.  I also didn&#8217;t want to do all the extra work of maintaining separate text for the [...]]]></description>
			<content:encoded><![CDATA[<p>So I have wanted to have dynamically generated META Code (title, description, keywords) for my Wordpress blog for sometime now. I tried all of the plug-ins and frankly, they just didn&#8217;t get me where I wanted to go.  I also didn&#8217;t want to do all the extra work of maintaining separate text for the META fields - I wanted them dynamically generated.</p>
<p>So I sat down and wrote the following code that I think you might find helpful to increase your blog&#8217;s SEO (Search Engine Optimization) value.</p>
<p>All of these changes should occur in your header.php file of your Wordpress blog&#8217;s template files.</p>
<p>First, I wanted to dynamically create the <strong>&lt;title&gt;</strong> tag with the blog&#8217;s name as the default, but include the category, archive or page title when I was browsing a category, archive or page. Here is the code to do that. Simply cut and paste this code, replacing your current &lt;title&gt;&lt;/title&gt; tag.</p>
<p>&lt;title&gt;&lt;?php if (is_home()): bloginfo(&#8217;name&#8217;); elseif (is_category()): bloginfo(&#8217;name&#8217;); print(&#8221; - &#8220;); single_cat_title(); elseif (is_day() || is_month() || is_year()): bloginfo(&#8217;name&#8217;); print(&#8221; - &#8220;); the_time(&#8217;F Y&#8217;); else: bloginfo(&#8217;name&#8217;); print(&#8221; - &#8220;); the_title(); endif; ?&gt;&lt;/title&gt;</p>
<p>Next, i wanted to dynamically create the <strong>&lt;META description&gt;</strong> tag to make it unique to each page of my blog. Specifically I wanted it to display the current category or archive I was browsing or if I was browsing a page I wanted it to dynamically create the description from the first 20 words of my  post. Here is the code to do that. Simply cut and paste this code, replacing the current &lt;META description=&#8221;" /&gt; tag.</p>
<p>&lt;meta name=&#8221;description&#8221; content=&#8221;&lt;?php if (have_posts()&amp;&amp; is_single()):while(have_posts()):the_post(); the_excerpt_rss(20,2); endwhile; elseif (is_category()): single_cat_title(); print(&#8221; category of the &#8220;); bloginfo(&#8217;name&#8217;); elseif (is_day() || is_month() || is_year()): the_time(&#8217;F Y&#8217;); print(&#8221; archive of the &#8220;); bloginfo(&#8217;name&#8217;); else: bloginfo(&#8217;description&#8217;); endif; ?&gt;&#8221; /&gt;</p>
<p>NOTE: You can change the number of words contained in the page description by changing the first number of the_excerpt_rss() function. So in my example, I have it set to 20 words - the_excerpt_rss(20,2). If I wanted 25 words, I would change it to this - the_excerpt_rss(25,2).</p>
<p>Finally, the <strong>&lt;META keywords&gt;</strong>. I wanted to keep the keywords consistent from category to archive to page, only adding additional category names or archive attributes.  Here is the code to do that. Simply cut and paste this code, replacing the current &lt;META keywords=&#8221;" /&gt; tag.</p>
<p>&lt;meta name=&#8221;keywords&#8221; content=&#8221;&lt;?php if (is_category()): single_cat_title(); print(&#8221;, &#8220;); elseif (is_day() || is_month() || is_year()): the_time(&#8217;F'); print(&#8221;, &#8220;); the_time(&#8217;Y'); print(&#8221;, &#8220;); endif;?&gt;travel, blog, destination, information, see, do, help, advice, reviews, save, savings, ideas, business, golf&#8221; /&gt;</p>
<p>That&#8217;s all there is to it! To make it easier for you, here is all of the change in once place so you just copy and paste once! Happy SEO!</p>
<p>&lt;title&gt;&lt;?php if (is_home()): bloginfo(&#8217;name&#8217;); elseif (is_category()): bloginfo(&#8217;name&#8217;); print(&#8221; - &#8220;); single_cat_title(); elseif (is_day() || is_month() || is_year()): bloginfo(&#8217;name&#8217;); print(&#8221; - &#8220;); the_time(&#8217;F Y&#8217;); else: bloginfo(&#8217;name&#8217;); print(&#8221; - &#8220;); the_title(); endif; ?&gt;&lt;/title&gt;<br />
&lt;meta name=&#8221;description&#8221; content=&#8221;&lt;?php if (have_posts()&amp;&amp; is_single()):while(have_posts()):the_post(); the_excerpt_rss(20,2); endwhile; elseif (is_category()): single_cat_title(); print(&#8221; category of the &#8220;); bloginfo(&#8217;name&#8217;); elseif (is_day() || is_month() || is_year()): the_time(&#8217;F Y&#8217;); print(&#8221; archive of the &#8220;); bloginfo(&#8217;name&#8217;); else: bloginfo(&#8217;description&#8217;); endif; ?&gt;&#8221; /&gt;<br />
&lt;meta name=&#8221;keywords&#8221; content=&#8221;&lt;?php if (is_category()): single_cat_title(); print(&#8221;, &#8220;); elseif (is_day() || is_month() || is_year()): the_time(&#8217;F'); print(&#8221;, &#8220;); the_time(&#8217;Y'); print(&#8221;, &#8220;); endif;?&gt;travel, blog, destination, information, see, do, help, advice, reviews, save, savings, ideas, business, golf&#8221; /&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.henriemedia.com/technical-support/dynamic-meta-code-for-wordpress/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fix for WordPress protected directory returning a 404 error</title>
		<link>http://www.henriemedia.com/technical-support/fix-for-wordpress-protected-directory-returning-a-404-error/</link>
		<comments>http://www.henriemedia.com/technical-support/fix-for-wordpress-protected-directory-returning-a-404-error/#comments</comments>
		<pubDate>Fri, 23 May 2008 20:26:09 +0000</pubDate>
		<dc:creator>Henrie Media Inc.</dc:creator>
		
		<category><![CDATA[Technical Support]]></category>

		<category><![CDATA[Web Applications]]></category>

		<guid isPermaLink="false">http://www.henriemedia.com/?p=25</guid>
		<description><![CDATA[I just installed WordPress as my default Content Management System (CMS) on Henriemedia.com. WordPress is an awesome open-source web application the provides an easy to use - yet extremely robust - interface and set of tools. I highly recommend using it for your next blog or CMS needs (shameless plug).
Anyways, I installed WordPress in the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.wordpress.org" target="_blank"><img class="alignright alignnone size-full wp-image-26" style="float: right;" title="wordpress-crystal-logo" src="http://www.henriemedia.com/wp-content/uploads/wordpress-crystal-logo.jpg" alt="" width="100" height="100" /></a>I just installed WordPress as my default Content Management System (CMS) on <a href='http://www.henriemedia.com'>Henriemedia.com</a>. WordPress is an awesome open-source web application the provides an easy to use - yet extremely robust - interface and set of tools. I highly recommend using it for your next blog or CMS needs (shameless plug).</p>
<p>Anyways, I installed WordPress in the root of my website and kept an administrative subdirectory from my previous website design, which is protected with a password using the &#8220;Protected Directory&#8221; function of Apache. For the sake of this article, we will say that subdirectory is called &#8220;travel&#8221; (there is no such directory on my website so please do not try and find it).</p>
<p>I then configured the WordPress settings for &#8220;Permalinks&#8221; to help with the Search Engine Optimization (SEO) value of my website. Everything was going along great. I started adding content and I was on my way - until I tried accessing the &#8220;travel&#8221; protected directory I setup. Every time I tried to access this folder I would get a 404 error. The reason the 404 error was displaying is because the .htaccess file, which was automatically created by the Permalinks settings, was causing the problem.</p>
<p>WordPress created .htaccess file looks like this -</p>
<p><code>RewriteEngine On<br />
RewriteBase /<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule . /index.php [L]</code></p>
<p>What it does is check to see if the requested filename is a regular file or a real directory.  If it’s neither of the two then redirect to /index.php, which is a WordPress entry. So Apache will load the file or directory instead of WordPress index.php. However, the fact that the requested directory is password protected with its own directory .htaccess file seems to cause Apache to think it’s not really a directory or file, thus satisfying the 2 tests and invoking WordPress&#8217;s index.php - and thus the 404 error.</p>
<p>After days (and I do mean days) of searching the forums on WordPress.org and many other forums, boards and blogs, I found two solutions to this problem.</p>
<p><strong>Please use one OR the other, do not implement both!</strong></p>
<p><strong>First, the .htaccess solution. </strong>NOTE: If you are not comfortable editing the .htaccess file, please scroll down and use the PHP solution. You need to added the following two lines of code to your .htaccess file:</p>
<p><code>ErrorDocument 401 /[path_to_file]/[file_name].html<br />
ErrorDocument 403 /[path_to_file]/</code><code>[file_name]</code><code>.html</code></p>
<p>Remember to change the [path_to_file] and {file_name].html values to the location of your custom error documents. So your the root .htaccess file should now look like this -</p>
<p><code>ErrorDocument 401 /[path_to_file]/[file_name].html<br />
ErrorDocument 403 /[path_to_file]/</code><code>[file_name]</code><code>.html<br />
</code><code>RewriteEngine On<br />
RewriteBase /<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule . /index.php [L]</code></p>
<p>Upload the .htaccess file and you should be up and running. Now I have seen some instances where this solution does not work, for whatever reason, or people do not feel comfortable editing their .htaccess files. If this is the case, please use the PHP solution below.</p>
<p><strong>Second, the PHP solution.</strong> You need to make the following changes to the &#8220;index.php&#8221; file that is in the root directory of your WordPress installation. When you open this file, it should have the following code -<br />
<code><br />
<em>&lt;?php<br />
/* Short and sweet */<br />
define(&#8217;WP_USE_THEMES&#8217;, true);<br />
require(&#8217;./wp-blog-header.php&#8217;);<br />
?&gt;</em><br />
</code><br />
<strong>Make sure you keep a backup copy of the &#8220;index.php&#8221; file just in case (you never know)!</strong></p>
<p>All you have to do is replace the original code with this code -</p>
<p><em>&lt;?php<br />
/* Short and sweet */<br />
$request_filename = $_SERVER['DOCUMENT_ROOT'].$_SERVER['REQUEST_URI'];<br />
$this_dir = dirname(__FILE__).&#8217;/';<br />
if($request_filename!=$this_dir &amp;&amp; $request_filename!=__FILE__ &amp;&amp; (is_file($request_filename) || is_dir($request_filename))) {<br />
// we are not supposed be here!<br />
die;<br />
}<br />
// load WordPress in /wp<br />
define(&#8217;WP_USE_THEMES&#8217;, true);<br />
require(&#8217;./wp-blog-header.php&#8217;);<br />
?&gt;</em></p>
<p>Now save the file and upload the new &#8220;index.php&#8221; file to the root folder of your WordPress installation directory and your done!</p>
<p>What the PHP solution does is it makes sure the request is not for the home directory or index.php itself - this is because you want WordPress to handle these.</p>
<p>Then it tests if the request is a regular file or a real directory - it dies if that’s the case. Basically you are doing what the two RewriteCond lines in .htaccess supposed to do.</p>
<p>Now your password protected directory correctly asks for password instead of showing WordPress&#8217;s 404 error page. All WordPress permalinks work. All non-protected directories work. My &#8220;travel&#8221; subdirectory is now usable again - YAHOO!</p>
<p>I must give credit where credit is due. I found the .htaccess solution on Textpattern.com and the PHP solution on ju-ju.com.</p>
<p>I hope one of these solutions work for you so you don&#8217;t have to waste as much time as I did!</p>
<p>As WordPress&#8217;s motto says &#8220;Code is Poetry&#8221;. Please leave a comment if you find this post to be helpful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.henriemedia.com/technical-support/fix-for-wordpress-protected-directory-returning-a-404-error/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
