Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Wordpress User Redirects

Featured Replies

Hi,

 

I'm currently using the s2member plugin 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.

 

My question is.

 

Can i have a link called "My Page" and have some code which says if page name = username then redirect to their page if not then redirect to home page?

 

Any code help would be great.

  • Author

UPDATE:

 

I have managed to create a hyperlink which takes the current logged in users username and redirects them to their page if created.

 

><a href="?php echo S2MEMBER_CURRENT_USER_LOGIN; ?>/">Client Area</a>

 

My next question is:

 

How can i wrap this in an if statement to say that if the username does not = a page name then redirect them to the home page?

  • Author

Hi All,

 

I now have the following code

 

<a href="<?php echo (defined('S2MEMBER_CURRENT_USER_LOGIN') ? S2MEMBER_CURRENT_USER_LOGIN : post_name);?>/">Client Area</a>

 

But it's still not redirecting the user if they don't have a page created?

 

Any help would be great!

  • 2 weeks later...
  • Author

I have now solved this issue. - Please close.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.