Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialScott Loveless
6,594 PointsFree membership site with restricted content
Great course. Although I haven't been able to find what I feel is the missing chapter. I'm building a membership site for a small organization similar to a search and rescue. I'd like to maintain an area with content only available to logged in members. The memberships will always be free so I have no need for all of the paid membership features that most of the pro plugins have built in.
I'm thinking that I can use custom page templates to add logical code to a members-only page that will display the WordPress login form instead of the content to anyone who is not logged in. Are the any plugins or code samples out there that can shed some light on this functionality?
1 Answer
Mark Truitt
17,230 PointsHi Scott,
Here are a few things for you to look at in reference to this.
https://developer.wordpress.org/reference/functions/is_user_logged_in/
https://codex.wordpress.org/Function_Reference/wp_login_form
Scott Loveless
6,594 PointsScott Loveless
6,594 PointsThanks for the feedback. I'm reading up on those functions. I'm also using the Members and Profile Builder plugins to add some user management features.