admin管理员组文章数量:1418092
I have a business directory website. I'd like to know how to create a page display condition. Basically, when clicking on the "add a listing" button, how do I make non-logged-in users be directly taken to the login/sign up page instead of the "choose a listing type" page?
(Currently, all users are taken to the "choose a listing type" page, and if not logged in, after choosing the type are asked to sign-in/sign up and then taken BACK to the "choose a listing type" page. It's a lot of unnecessary back-and-forths.)
I have a business directory website. I'd like to know how to create a page display condition. Basically, when clicking on the "add a listing" button, how do I make non-logged-in users be directly taken to the login/sign up page instead of the "choose a listing type" page?
(Currently, all users are taken to the "choose a listing type" page, and if not logged in, after choosing the type are asked to sign-in/sign up and then taken BACK to the "choose a listing type" page. It's a lot of unnecessary back-and-forths.)
Share Improve this question edited Jul 30, 2019 at 22:42 Castiblanco 2,1947 gold badges20 silver badges26 bronze badges asked Jul 30, 2019 at 22:35 Myriam RichardMyriam Richard 1 1- What is the add a listing button and how is it implemented in code? – Tom J Nowell ♦ Commented Jul 30, 2019 at 23:08
1 Answer
Reset to default 0You can use this filter so when user comes into your website so you will redirect to them on specific page and display that specific page.
function user_redirect_page() {
return site_url().'your-page-slug';
}
add_filter('login_redirect', 'user_redirect_page');
本文标签: phpDisplay specific page if user signed in
版权声明:本文标题:php - Display specific page if user signed in 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745282054a2651478.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论