Forums

Join
bbPress Support ForumsTroubleshootingPhp help - Welcome Message

Info

Tags

Php help - Welcome Message

  1. Okay - so I'm trying to change my Welcome MEssage on the home page. Right now it says:
    "Welcome back Welcome, USERNAME!"

    The code that produces this looks like this:
    <?php if ( !in_array( bb_get_location(), array( 'login-page', 'register-page' ) ) ) login_form(); ?>

    That's utter gobbledy gook as far as I"m concerned. Can anyone decifer it? Why is "welcome" appearing twice? Where are the words coming from? Whay if I wanted it to say "Go away USERNAME"? Where is that php getting it's information from?

    Second line looks like this, which is fine:
    "User Options: Admin | Log Out"

    Since I'm admin, I assume that's why I see admin. Other users would just see Log Out? or what? The code producing that is equally cryptic. Where does it come from? What if I wanted to, say, change the p class that gets slapped around that?

    Thanks!

  2. The words are stored in a file called logged-in.php in your theme.

    In Kakumei (the default), it looks like this:

    <p class="login">
    	<?php printf(__('Welcome, %1$s'), bb_get_profile_link(bb_get_current_user_info( 'name' )));?>
    	<?php bb_admin_link( 'before= | ' );?>
    	| <?php bb_logout_link(); ?>
    </p>

    Using __( translates into the appropriate language, and %1$s is a placeholder that gets replaced by the user's name

    Not sure why it's saying Welcome twice though

  3. Excellent thanks a lot, that worked perfectly. (The double welcome was bad code from the themer)

  4. You must log in to post.