0

As a newbie, I've had a hard time finding a good starting point. I believe my case is fairly common and maybe this question has been answered comprehensively elsewhere.

I am creating a simple site for a non-profit agency. The public front end has the basic About/Blog/Donate/Contact pages.

The (non-paid) members-only side will have a blog, events calendar, forum, and a table displaying meta info for all users.

I am searching for the best starting point to implement this. I don't know whether to build a members.domain.org subdomain, or to simply add code to restricted pages that would redirect non-logged-in users.

Thank you in advance for any insight. My searches continue to lead me into a jungle of WordPress plugins and I'm feeling lost.

2
  • The easiest approach would be to use the WordPress roles and restrict content to that role then have members register. If it is a paid membership you will have more work cut out for you. Depending on the budget etc, it may be worthwhile looking into different software to handle the forums etc. There are many ways to accomplish what you are asking, but your question is a little too broad. It might also be worthwhile consulting someone one-on-one as you will get a ton of different directions in the wild i.e. this forum lol Commented Jul 7, 2016 at 16:15
  • Thank you for your response. the memberships will not be paid. It looks like there is an abundance of great plugins for running paid membership sites but I simply need to restrict content for anybody who is not logged in as a subscriber. I am going to attend my first WordPress meetup this week and hopefully find some of that one-on-one insight. Commented Jul 8, 2016 at 18:35

1 Answer 1

0

I think the answer is "it depends" -- on how flexible and/or "slick" you want the solution to be. The quickest/easiest thing to do would be to create a custom post type (there are tried/true plugins out there that can help establish this) -- and then in your theme functions.php (or in a very simple plugin), put in logic that redirects non-logged in users to a page of your choice, if the current post is of that type:

function guest_restrict () {
    if ( !is_user_logged_in() && "restricted_post" == get_post_type( get_the_ID() ) )
        wp_redirect( 'http://www.foosite.com/some/page' );
}
add_action('template_redirect','guest_restrict');

A "full blown" solution would be to bolt in a membership system (plugin) but that is a much bigger deal.

6
  • Thanks for your response, C C. This seems like a simple solution. I do have some experience with creating post types as you suggest. Commented Jul 8, 2016 at 18:43
  • So once I create the custom post type of restricted_post, I can simply call that post type by using WP_Query on any page that I want to be restricted? Commented Jul 8, 2016 at 18:50
  • Scott, I don't even think it's that complicated -- if you use one of the well-known plugins for "custom post type", then in the page editor you'll have the opportunity to select that post type from a drop-down dialog - thus making the page that type. Then in your theme's functions.php you could put the code I gave you into a function then make that function a call-back for the template_redirect hook. I'll update my answer to flesh that out a bit more for you.
    – C C
    Commented Jul 8, 2016 at 19:06
  • Thanks, @C C, this makes sense. However I seem to be missing something, because I'm using the plugin, but I don't have any dropdown menu in the page editor to select a custom post type. All screen options are displayed. Commented Jul 9, 2016 at 12:56
  • Maybe we're talking about different plugins (there's a slew of them out there). I was thinking of something like this: wordpress.org/plugins/types which allows you to set post types, taxonomies, etc through a GUI.
    – C C
    Commented Jul 9, 2016 at 16:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.