<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	>
<channel>
	<title>Comments for ben-huddleston.com</title>
	<atom:link href="http://www.ben-huddleston.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ben-huddleston.com</link>
	<description>Website of Ben Huddleston - right now it's mainly a playground for testing Wordpress plugins.</description>
	<pubDate>Sun, 05 Jul 2009 17:19:34 +0000</pubDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on User only/protected pages in WordPress by James</title>
		<link>http://www.ben-huddleston.com/coding/user-onlyprotected-pages-in-wordpress-2/comment-page-2/#comment-1550</link>
		<dc:creator>James</dc:creator>
		<pubDate>Tue, 28 Apr 2009 21:50:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.redwingstudio.com/2007/04/05/user-onlyprotected-pages-in-wordpress-2/#comment-1550</guid>
		<description>Hi Ben,

This is exactly what I have been looking for. The only problem is that the download is not available anymore. Could you please send me the file or the link to it?

Thank you very much,
James</description>
		<content:encoded><![CDATA[<p>Hi Ben,</p>
<p>This is exactly what I have been looking for. The only problem is that the download is not available anymore. Could you please send me the file or the link to it?</p>
<p>Thank you very much,<br />
James</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on User only/protected pages in WordPress by Exam Philippines</title>
		<link>http://www.ben-huddleston.com/coding/user-onlyprotected-pages-in-wordpress-2/comment-page-2/#comment-1552</link>
		<dc:creator>Exam Philippines</dc:creator>
		<pubDate>Sat, 04 Apr 2009 17:02:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.redwingstudio.com/2007/04/05/user-onlyprotected-pages-in-wordpress-2/#comment-1552</guid>
		<description>do you have a downloadable plugin for this? because i don't understand how to apply the codes. thanks!</description>
		<content:encoded><![CDATA[<p>do you have a downloadable plugin for this? because i don&#8217;t understand how to apply the codes. thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on User only/protected pages in WordPress by Mukesh</title>
		<link>http://www.ben-huddleston.com/coding/user-onlyprotected-pages-in-wordpress-2/comment-page-2/#comment-1551</link>
		<dc:creator>Mukesh</dc:creator>
		<pubDate>Fri, 20 Mar 2009 20:55:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.redwingstudio.com/2007/04/05/user-onlyprotected-pages-in-wordpress-2/#comment-1551</guid>
		<description>Hi, I'm wondering if this same method will work for posts. The items here only mention page, but will this work for posts?
Thanks
Mukesh</description>
		<content:encoded><![CDATA[<p>Hi, I&#8217;m wondering if this same method will work for posts. The items here only mention page, but will this work for posts?<br />
Thanks<br />
Mukesh</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on AJAX Contact Form with PHP Fallback by ron</title>
		<link>http://www.ben-huddleston.com/php/ajax-contact-form-with-php-fallback-2/comment-page-1/#comment-1494</link>
		<dc:creator>ron</dc:creator>
		<pubDate>Mon, 26 Jan 2009 17:39:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.redwingstudio.com/2007/04/05/ajax-contact-form-with-php-fallback/#comment-1494</guid>
		<description>hi:

doing some research on php form validation and found your example. the download link is no longer working. would you mind sending to my email so I can further evaluate? thank you!</description>
		<content:encoded><![CDATA[<p>hi:</p>
<p>doing some research on php form validation and found your example. the download link is no longer working. would you mind sending to my email so I can further evaluate? thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on User only/protected pages in WordPress by Items of interest &#187; Blog Archive &#187; Bookmarks for December 3rd through December 4th</title>
		<link>http://www.ben-huddleston.com/coding/user-onlyprotected-pages-in-wordpress-2/comment-page-2/#comment-1549</link>
		<dc:creator>Items of interest &#187; Blog Archive &#187; Bookmarks for December 3rd through December 4th</dc:creator>
		<pubDate>Thu, 04 Dec 2008 11:09:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.redwingstudio.com/2007/04/05/user-onlyprotected-pages-in-wordpress-2/#comment-1549</guid>
		<description>[...] User only/protected pages in WordPress &#124; Redwing Studio - [...]</description>
		<content:encoded><![CDATA[<p>[...] User only/protected pages in WordPress | Redwing Studio - [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on User only/protected pages in WordPress by Create Protected pages (Members only) in Wordpress &#124; Wordpress</title>
		<link>http://www.ben-huddleston.com/coding/user-onlyprotected-pages-in-wordpress-2/comment-page-2/#comment-1548</link>
		<dc:creator>Create Protected pages (Members only) in Wordpress &#124; Wordpress</dc:creator>
		<pubDate>Sun, 05 Oct 2008 11:22:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.redwingstudio.com/2007/04/05/user-onlyprotected-pages-in-wordpress-2/#comment-1548</guid>
		<description>[...] is â€“ If you have the password you can view. Here&#8217;s a protected page plugin template by redwing studio; condition is - If you are member of this blog, you can [...]</description>
		<content:encoded><![CDATA[<p>[...] is â€“ If you have the password you can view. Here&#8217;s a protected page plugin template by redwing studio; condition is - If you are member of this blog, you can [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on AJAX Contact Form with PHP Fallback by mx3design</title>
		<link>http://www.ben-huddleston.com/coding/ajax-contact-form-with-php-fallback/comment-page-1/#comment-1483</link>
		<dc:creator>mx3design</dc:creator>
		<pubDate>Sun, 05 Oct 2008 09:45:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.minc.info/?p=106#comment-1483</guid>
		<description>I found Andrew's script but not a web site:
http://www.codewalkers.com/c/a/Email-Code/Basic-Ajax-contact-form/</description>
		<content:encoded><![CDATA[<p>I found Andrew&#8217;s script but not a web site:<br />
<a href="http://www.codewalkers.com/c/a/Email-Code/Basic-Ajax-contact-form/" rel="nofollow">http://www.codewalkers.com/c/a/Email-Code/Basic-Ajax-contact-form/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Easy Vignette in Photoshop CS2 by Tiff</title>
		<link>http://www.ben-huddleston.com/personal/easy-vignette-in-photoshop-cs2/comment-page-1/#comment-1481</link>
		<dc:creator>Tiff</dc:creator>
		<pubDate>Thu, 02 Oct 2008 02:21:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.minc.info/?p=70#comment-1481</guid>
		<description>i've always wondered how to do this.. but not many are willing to share what they know. THANK YOU SO MUCH!</description>
		<content:encoded><![CDATA[<p>i&#8217;ve always wondered how to do this.. but not many are willing to share what they know. THANK YOU SO MUCH!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on User only/protected pages in WordPress by Rupert</title>
		<link>http://www.ben-huddleston.com/coding/user-onlyprotected-pages-in-wordpress-2/comment-page-2/#comment-1547</link>
		<dc:creator>Rupert</dc:creator>
		<pubDate>Wed, 27 Aug 2008 23:04:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.redwingstudio.com/2007/04/05/user-onlyprotected-pages-in-wordpress-2/#comment-1547</guid>
		<description>Ben - it worked like a champ first time.  Thank you very much!

The only issue I ran into, and it has nothing to do with the script, was having it fit seemlessly into my site theme.  I was able to poke around and copy some stuff from the single.php and page files in the theme directory and manipulate the stylesheet some, but the result was still pretty amatureish.  I am using FTW 2.0 theme by flisterz...one of the best themes that I have seen on the WP platform; if anyone cares to take a stab at melding the protected.phps here with it to create a seemless page template, I would really appreciate it.

The ironic thing is, this might be a 5 minute job because I know I am pretty close, but not been able to speak programming, my abilities fall short of completing it.

I would post a link to my site, but I currently only have it on MAMPS on my IMAC.

Thanks very much again Ben.


Rupe</description>
		<content:encoded><![CDATA[<p>Ben - it worked like a champ first time.  Thank you very much!</p>
<p>The only issue I ran into, and it has nothing to do with the script, was having it fit seemlessly into my site theme.  I was able to poke around and copy some stuff from the single.php and page files in the theme directory and manipulate the stylesheet some, but the result was still pretty amatureish.  I am using FTW 2.0 theme by flisterz&#8230;one of the best themes that I have seen on the WP platform; if anyone cares to take a stab at melding the protected.phps here with it to create a seemless page template, I would really appreciate it.</p>
<p>The ironic thing is, this might be a 5 minute job because I know I am pretty close, but not been able to speak programming, my abilities fall short of completing it.</p>
<p>I would post a link to my site, but I currently only have it on MAMPS on my IMAC.</p>
<p>Thanks very much again Ben.</p>
<p>Rupe</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on User only/protected pages in WordPress by Ben</title>
		<link>http://www.ben-huddleston.com/coding/user-onlyprotected-pages-in-wordpress-2/comment-page-2/#comment-1545</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Mon, 25 Aug 2008 05:00:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.redwingstudio.com/2007/04/05/user-onlyprotected-pages-in-wordpress-2/#comment-1545</guid>
		<description>Rupert,

It should be fairly simple to do what you want.  As in Ralphie's case, you'll need to create the capabilities using the Role Manager plugin.  For what you want to do, you'll need two capabilities.  You can name them whatever you want: "View My Hidden Posts" and "View My Other Hidden Posts" might be options.  To do that go to Users –&gt; Capabilities and type “View My Hidden Posts” minus the quotes into the New Capability Name input box and click Create Capability.  Now do the same for "View My Other Hidden Posts".

Create two new roles or use existing roles and then just check off the new capability that is applicable for each role (either View My Hidden Posts or View My Other Hidden Posts).  For this example, let's call those we want to assign to Group 1 "Studs" and those in Group 2 "Duds".

Then, you have a choice, you can incorporate this all into one page template or have two different page templates.  The simplest method is probably making two different page templates and assign whichever template is appropriate to the page.  Go grab a copy of this file here: http://www.redwingstudio.com/downloads/user-and-role-protected.phps (copy and paste it into your own blank php page and make two copies).

You can name the templates whatever you want.  In WordPress you name page templates by adding this at the top of the page:
&lt;code&gt;
&lt;?php /* Template Name: Hidden Page
*/ ?&gt;
&lt;/code&gt;

Just replace "Hidden Page" on my example template with whatever you want to name your template.  For the sake of my example, I'll call them "Hidden Page for Studs" and "Hidden Page for Duds".

Now, you have your two copies of the hidden page template, but you need to make a change to our second one so we show the "duds" only the content that they should see. On the duds template, look for this line:
&lt;code&gt;if ( current_user_can('view_my_hidden_posts') ) {&lt;/code&gt;
replace it with
&lt;code&gt;if ( current_user_can('view_my_other_hidden_posts') ) {&lt;/code&gt;

Now, when you create a page that you want to be hidden, just choose the appropriate template from the template drop down.  If it's a page that only studs should see, choose the "Hidden Page for Studs" template.  If it's a page for duds, choose the "Hidden Page for Duds" template.

I'm not sure how you're handling your navigation, but if you're creating links manually or have a separate section of the nav that you're creating specifically for these pages, you can set it up so that only people who are logged in can see those pages and they would only see pages they had access to be they a dud or a stud.  To do that, you'll just need to wrap a few if statements around your navigation:

First, wrap this around all the nav links that should be hidden or show depending on whether someone is logged in:

&lt;code&gt;
&lt;?php
if (is_user_logged_in()) {
// your navigation links will go here
}
?&gt;
&lt;/code&gt;

Then, you need to add the checks inside of the check for the user being logged in to show content for only the duds and studs:

&lt;code&gt;
&lt;?php
if (is_user_logged_in()) {
    if ( current_user_can('view_my_hidden_posts') ) {
      // stud links go here
    } else if ( current_user_can('view_my_other_hidden_posts') ) {
       // dud links go here
    }
}
?&gt;
&lt;/code&gt;

Hope the above helps. Let me know if you have any more questions.

Here are some links to some resources I found helpful when I was working with the capabilities and integrating them into the template:
http://codex.wordpress.org/Roles_and_Capabilities
http://boren.nu/archives/2005/12/01/whats-new-in-20-roles-and-capabilities/</description>
		<content:encoded><![CDATA[<p>Rupert,</p>
<p>It should be fairly simple to do what you want.  As in Ralphie&#8217;s case, you&#8217;ll need to create the capabilities using the Role Manager plugin.  For what you want to do, you&#8217;ll need two capabilities.  You can name them whatever you want: &#8220;View My Hidden Posts&#8221; and &#8220;View My Other Hidden Posts&#8221; might be options.  To do that go to Users –> Capabilities and type “View My Hidden Posts” minus the quotes into the New Capability Name input box and click Create Capability.  Now do the same for &#8220;View My Other Hidden Posts&#8221;.</p>
<p>Create two new roles or use existing roles and then just check off the new capability that is applicable for each role (either View My Hidden Posts or View My Other Hidden Posts).  For this example, let&#8217;s call those we want to assign to Group 1 &#8220;Studs&#8221; and those in Group 2 &#8220;Duds&#8221;.</p>
<p>Then, you have a choice, you can incorporate this all into one page template or have two different page templates.  The simplest method is probably making two different page templates and assign whichever template is appropriate to the page.  Go grab a copy of this file here: <a href="http://www.redwingstudio.com/downloads/user-and-role-protected.phps" rel="nofollow">http://www.redwingstudio.com/downloads/user-and-role-protected.phps</a> (copy and paste it into your own blank php page and make two copies).</p>
<p>You can name the templates whatever you want.  In WordPress you name page templates by adding this at the top of the page:<br />
<code><br />
< ?php /* Template Name: Hidden Page<br />
*/ ?><br />
</code></p>
<p>Just replace &#8220;Hidden Page&#8221; on my example template with whatever you want to name your template.  For the sake of my example, I&#8217;ll call them &#8220;Hidden Page for Studs&#8221; and &#8220;Hidden Page for Duds&#8221;.</p>
<p>Now, you have your two copies of the hidden page template, but you need to make a change to our second one so we show the &#8220;duds&#8221; only the content that they should see. On the duds template, look for this line:<br />
<code>if ( current_user_can('view_my_hidden_posts') ) {</code><br />
replace it with<br />
<code>if ( current_user_can('view_my_other_hidden_posts') ) {</code></p>
<p>Now, when you create a page that you want to be hidden, just choose the appropriate template from the template drop down.  If it&#8217;s a page that only studs should see, choose the &#8220;Hidden Page for Studs&#8221; template.  If it&#8217;s a page for duds, choose the &#8220;Hidden Page for Duds&#8221; template.</p>
<p>I&#8217;m not sure how you&#8217;re handling your navigation, but if you&#8217;re creating links manually or have a separate section of the nav that you&#8217;re creating specifically for these pages, you can set it up so that only people who are logged in can see those pages and they would only see pages they had access to be they a dud or a stud.  To do that, you&#8217;ll just need to wrap a few if statements around your navigation:</p>
<p>First, wrap this around all the nav links that should be hidden or show depending on whether someone is logged in:</p>
<p><code><br />
< ?php<br />
if (is_user_logged_in()) {<br />
// your navigation links will go here<br />
}<br />
?><br />
</code></p>
<p>Then, you need to add the checks inside of the check for the user being logged in to show content for only the duds and studs:</p>
<p><code><br />
< ?php<br />
if (is_user_logged_in()) {<br />
    if ( current_user_can('view_my_hidden_posts') ) {<br />
      // stud links go here<br />
    } else if ( current_user_can('view_my_other_hidden_posts') ) {<br />
       // dud links go here<br />
    }<br />
}<br />
?><br />
</code></p>
<p>Hope the above helps. Let me know if you have any more questions.</p>
<p>Here are some links to some resources I found helpful when I was working with the capabilities and integrating them into the template:<br />
<a href="http://codex.wordpress.org/Roles_and_Capabilities" rel="nofollow">http://codex.wordpress.org/Roles_and_Capabilities</a><br />
<a href="http://boren.nu/archives/2005/12/01/whats-new-in-20-roles-and-capabilities/" rel="nofollow">http://boren.nu/archives/2005/12/01/whats-new-in-20-roles-and-capabilities/</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
