Forums

Dynamic Page creation as Users Create Accounts (4 posts)

  1. Lewke
    Member
    Posted 10 months ago #

    Hey All;

    Have been designing websites for years, and have been getting more and more requests for WP based sites.

    I need to know if WP has the potential to have clients sign-up, have a personal page dynamically created and databased, and then for that user to be able to log into their account and be directed right to their personal page and/or sub-pages?

    Appreciate any and all answers, examples would be great as well.

    Thank you for your time!

  2. areimann
    Member
    Posted 10 months ago #

    I'm looking for the same.

  3. Micah
    Member
    Posted 9 months ago #

    This is absolutely possible. The easiest way to get this done is to create a page template (something like 'Members Page'). The page template would pull the necessary information for the current logged in user and would redirect anyone who is not logged in to the homepage via a 301 redirect (use wp_redirect() function for this).

    Use a plugin like this to redirect users once they login: http://wordpress.org/extend/plugins/peters-login-redirect/

    You can also redirect users using your own function, like this:

    add_filter('login_redirect', 'my_login_redirect' );
    function my_login_redirect( $url ){
         global $user;
         $user = new WP_User( @$user->ID );
         if( $user->has_cap('edit_posts') ){
             return $url;
         }
         return site_url('/members/');
    }

    This function will redirect any user who is a subscriber to the members page located off of the main site URL.

  4. areimann
    Member
    Posted 9 months ago #

    This might work. I'm doing something a little different, but I probably can change this:

    return site_url('/members/');

    to something like:

    return site_url('/members/'. $user->user_name .'/');

    and get what I need.

    thanks

Reply

You must log in to post.

About this Topic