I'm currently using the s2member plugin for wordpress to allow me to create a client portal where users can log in and visit their own secure unique page. (This uses custom capability and the page must be called the same as their username.)
But then i also have people that just log on to view my blog and are not clients and do not have pages created for them.
I have the following code:
This works fine when logged in as a user who has a page created but gives an 404 error for a user that does not have a page.PHP Code:
<a href="?php echo S2MEMBER_CURRENT_USER_LOGIN; ?>/">Client Area</a>
My question is:
Could the above code be wrapped in an if statement to say that if the S2MEMBER_CURRENT_USER_LOGIN does not = post_name then redirect them to the home page?