admin管理员组文章数量:1023782
I want to create public WordPress website (for a sports club), but with one closed area just for the members.
The public part of the site will have the usual pages: club info, photo gallery, contact page...
The closed site area:
- will have access thru login page (as page added in the menu / navigation)
- a member must type the username and password in order to login
- after the login, each member can see only one page (page created just for him / her, with info related to them (text, photo...)
- after the review of the personalized page, the member can log-out (or "the system" can do it in (for example) 30 minutes)
Can I achieve all described above thru WP user roles, or with any free or paid plugin?
I want to create public WordPress website (for a sports club), but with one closed area just for the members.
The public part of the site will have the usual pages: club info, photo gallery, contact page...
The closed site area:
- will have access thru login page (as page added in the menu / navigation)
- a member must type the username and password in order to login
- after the login, each member can see only one page (page created just for him / her, with info related to them (text, photo...)
- after the review of the personalized page, the member can log-out (or "the system" can do it in (for example) 30 minutes)
Can I achieve all described above thru WP user roles, or with any free or paid plugin?
Share Improve this question asked Apr 23, 2019 at 19:44 DeeJayDeeJay 11 Answer
Reset to default 0Yes, there are tons of plugins to realize this. In my opinion, the most reliable, streamlined and bugfree plugin is "members" by Justin Tadlock.
As I've said, there are hundrets if not thousands of plugins which can do this. Just browse the plugin directory.
On the other hand, building some custom redirects is not that hard. You could add a redirect filter via
<?php
/**
* Redirect user after successful login.
*
* @param string $redirect_to URL to redirect to.
* @param string $request URL the user is coming from.
* @param object $user Logged user's data.
* @return string
*/
function my_login_redirect( $redirect_to, $request, $user ) {
//is there a user to check?
if (isset($user->roles) && is_array($user->roles)) {
//check for subscribers
if (in_array('subscriber', $user->roles)) {
// redirect them to another URL, in this case, the homepage
$redirect_to = home_url(); // Change this to page id for example
}
}
return $redirect_to;
}
add_filter( 'login_redirect', 'my_login_redirect', 10, 3 );
?>
Please keep in mind that this is just a shot in the dark (copied from codex) and not a full solution. See: Codex Link
I want to create public WordPress website (for a sports club), but with one closed area just for the members.
The public part of the site will have the usual pages: club info, photo gallery, contact page...
The closed site area:
- will have access thru login page (as page added in the menu / navigation)
- a member must type the username and password in order to login
- after the login, each member can see only one page (page created just for him / her, with info related to them (text, photo...)
- after the review of the personalized page, the member can log-out (or "the system" can do it in (for example) 30 minutes)
Can I achieve all described above thru WP user roles, or with any free or paid plugin?
I want to create public WordPress website (for a sports club), but with one closed area just for the members.
The public part of the site will have the usual pages: club info, photo gallery, contact page...
The closed site area:
- will have access thru login page (as page added in the menu / navigation)
- a member must type the username and password in order to login
- after the login, each member can see only one page (page created just for him / her, with info related to them (text, photo...)
- after the review of the personalized page, the member can log-out (or "the system" can do it in (for example) 30 minutes)
Can I achieve all described above thru WP user roles, or with any free or paid plugin?
Share Improve this question asked Apr 23, 2019 at 19:44 DeeJayDeeJay 11 Answer
Reset to default 0Yes, there are tons of plugins to realize this. In my opinion, the most reliable, streamlined and bugfree plugin is "members" by Justin Tadlock.
As I've said, there are hundrets if not thousands of plugins which can do this. Just browse the plugin directory.
On the other hand, building some custom redirects is not that hard. You could add a redirect filter via
<?php
/**
* Redirect user after successful login.
*
* @param string $redirect_to URL to redirect to.
* @param string $request URL the user is coming from.
* @param object $user Logged user's data.
* @return string
*/
function my_login_redirect( $redirect_to, $request, $user ) {
//is there a user to check?
if (isset($user->roles) && is_array($user->roles)) {
//check for subscribers
if (in_array('subscriber', $user->roles)) {
// redirect them to another URL, in this case, the homepage
$redirect_to = home_url(); // Change this to page id for example
}
}
return $redirect_to;
}
add_filter( 'login_redirect', 'my_login_redirect', 10, 3 );
?>
Please keep in mind that this is just a shot in the dark (copied from codex) and not a full solution. See: Codex Link
本文标签: pluginsPublic WP website with one area just for members
版权声明:本文标题:plugins - Public WP website with one area just for members 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745561710a2156199.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论