简体   繁体   English

Wordpress插件重定向到先登录

[英]Wordpress plugin to redirect to login first

I have a WordPress site which I am using to teach online.我有一个 WordPress 网站,我用它来在线教学。 Some of the courses are free but I want users to login before they are able to take the free courses.有些课程是免费的,但我希望用户在他们能够参加免费课程之前登录。 The users are free to visit the site but they should be logged to take the free course.用户可以自由访问该网站,但他们应该登录以参加免费课程。 If a user clicks a link to take a course, they will be redirected to login and then they can take the course.如果用户单击链接参加课程,他们将被重定向到登录,然后他们可以参加课程。

I need a plugin to do this for me.我需要一个插件来为我做这件事。 Any recommendations will be appreciated.任何建议将不胜感激。

Yes there is a plugin for this是的,有一个插件

See this plugin: https://wordpress.org/plugins/redirection/看到这个插件: https://wordpress.org/plugins/redirection/

Add the shortcode/function provided by this plugin to the page you want to be redirected to the first login.将此插件提供的短代码/功能添加到您要重定向到第一次登录的页面。 And set conditions for it as well and the condition you want is that the page should be redirected to the login page only if the user is not logged in and if he/she is logged in then they should not be redirected并为其设置条件,您想要的条件是,只有当用户未登录并且他/她已登录时,页面才应重定向到登录页面,则不应重定向它们

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM