Redirect to login page when attempting to ask or answer a question
override ask.php and add this at top:
if(!is_user_logged_in()){ auth_redirect(); }
zee1116 (Buyer) commented
Thank you! I will try that.
zee1116 (Buyer) commented
The above solution did not work. For what I can tell, the login redirect has to be placed at the very top of the page being called and in anspress ask.php is an included part of a page rather than a page itself. The header and page title are already included before ask.php is included. So that solution definitely wouldn’t work
Answered here: https://anspress.io/questions/question/how-to-remove-login-popup-and-redirect-user-on-user-pro-login-page/