latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Displaying "Welcome X" on top

Home Forums Community Forum Displaying "Welcome X" on top

This topic contains 3 replies, has 2 voices. Last updated by  cassel 4 years, 8 months ago.

Topic Author Topic
Posted: Monday Apr 30th, 2012 at 6:14 am #12212
cassel
Username: cassel

As i am creating a sister site to my Scrapbook Campus, i want to replicate the Login / Register on top of the site, where it turns to Welcome Username /Logout once the person logs in. I did it last year, but i cannot figure out how i did it. I know it is not a login widget. I think it is one setting that i used, from somewhere in s2M to do it, but i am stumped. Check out what i mean on top of all the pages:
http://scrapbookcampus.com I also know it is automatically added to any new page so it is not coded one page at the time.

Anyone can point me to the setting to adjust?

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Monday Apr 30th, 2012 at 6:01 pm #12240
Raam Dev
Username: Raam
Staff Member

You can use a snippet of code like the following in the header where the “Login / Register” shows up:

if ( is_user_logged_in() ) {
    echo 'Welcome ' . S2MEMBER_CURRENT_USER_DISPLAY_NAME . ' / <a href="' . wp_logout_url( $redirect ) . '">Logout</a>';
} else {
    echo '<a href="/wp-login.php">Login</a> / <a href="/register/">Register</a>';
} 
Posted: Monday Apr 30th, 2012 at 7:11 pm #12252
cassel
Username: cassel

Hum, that might work but i doubt it is what i used. Strangely, i cannot even figure out where the code i used IS right now! Weird.

Posted: Monday Apr 30th, 2012 at 11:32 pm #12256
cassel
Username: cassel

Ok i figured it out, and you were right. Now, just to figure out how i put it where it is! (next challenge!)

Viewing 3 replies - 1 through 3 (of 3 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.