• Thanks for the great plugin. Enjoying getting to know it.

    I am trying to send people to a customized link for their profile page. It worked just super on the first role I tried it with.

    Then I slept.

    And now when I try this with another role, the profile page is showing the login form in the content area. It is sending me to the right URL that I put in User Links. Just not showing the right content.

    On the page that I have the custom profile link going to, I have inserted the [theme-my-login] shortcode.

    Suggestions?

    Thanks,
    Doug

    https://wordpress.org/plugins/theme-my-login/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jeff Farthing

    (@jfarthing84)

    The shortcode, by default, displays the Login form.

    Thread Starter dmlWS

    (@dmlws)

    So then I take the short code off of that page? Or is there a different short code that will display the profile form?

    The thing that is confusing me is that the same setup is working for a different role’s login. On that one…

    Here are screenshots of the one that is working…
    http://www.screencast.com/t/tSSkCi5kU4

    I made the URL on the front end screenshots show up so you could compare them to their back end pages. Also, I included shots of the user links and redirection settings.

    Thanks,
    Doug

    Plugin Author Jeff Farthing

    (@jfarthing84)

    Are both profile pages not the same?

    Thread Starter dmlWS

    (@dmlws)

    I’m trying to give different header, sidebar and widget content on the layout for different profiles.

    Plugin Author Jeff Farthing

    (@jfarthing84)

    I would just implement some code to serve up a different template for each role:

    function tml_template_include( $template ) {
    	if ( is_user_logged_in() ) {
    		$user = wp_get_current_user();
    		$role = reset( $user->roles );
    
    		$templates = array(
    			"profile-$role.php",
    			"profile.php"
    		);
    
    		$found = get_query_template( 'profile', $templates );
    		if ( $found )
    			return $found;
    	}
    	return $template;
    }
    add_filter( 'template_include', 'tml_template_include' );

    This code will first look for a template specific to the current user’s role (e.g. “profile-subscriber.php”). If that’s not found, it will try “profile.php”. If that’s not found, it reverts back to WP’s choice in template.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Custom User Link for Profile Page Not Working’ is closed to new replies.