Support » Theme: Twenty Twelve » [Twenty Twelve] Adding elements to the right side of header image

  • Resolved Havends


    What I would basically like to do is to add something like:

    Welcome to MyBlogName!
    Register | Login

    for guests, and,

    Welcome USERNAME!
    Edit your profile | Sign out

    for registered users, to the right side of the header image of Twenty Twelve theme (after reducing the width of header image).
    Using solutions like:

    <?php wp_register(); ?>
    <?php wp_loginout(); ?>

    made each link appear on separate lines. I would like them to appear in the same line.

    It would be great if you could also direct me to adding a ‘Header widget’ that would align to the right of the header image, which would enable easy additions of links, Search box, etc.

    NB: I am currently working on the theme using Bitnami WordPress Stack. If you want, I can upload the theme files, if necessary.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Try to include the content within the headers H1.

    the default output of wp_register() is a html li element; use the corresponding parameter to remove that:


    <?php wp_register(' ',' '); ?> | <?php wp_loginout(); ?>

    Thanks a ton alchymyth! It turned out to be just the thing I needed (I am not much into php; just able to understand some parts of it as I go on reading codes). 🙂

    @thorhammer Thanks for your valuable time and suggestion. 🙂

    After searching around, the following code is what I am using now (to make it easy for other users searching for a solution).

    Please suggest a better alternative, if you have any.

    <div class="welcomein">
    <?php global $user_ID; if( $user_ID ) : ?>
    Welcome <?php global $current_user; get_currentuserinfo(); echo ($current_user->user_login); ?>
    <?php else : ?>
    Welcome to My Site!</br>Please
    <?php endif; ?>
    <?php wp_register(' ',' '); ?> | <?php wp_loginout(); ?></div>

    Still one doubt…
    Using <?php wp_register(' ',' '); ?> gives me “Register” or “Site Admin”.
    I am looking forward to restricting “Subscribers” from Admin pages. So, how can I display “Edit your profile” (wp-admin/profile.php) instead of “Site Admin” (wp-admin/) ?

    you could possibly add a filter function into functions.php of your theme;


    //change 'Site Admin' link and text for logged in 'subscribers' to point to 'Edit your Profile'//
    //anybody with higher capabilities such as 'contributor' and above will get linked to 'Site Admin'//
    function point_admin_link_to_profile( $link ) {
    //check for 'subscriber' with checking for cannot 'edit_posts'//
    if( is_user_logged_in() && !current_user_can('edit_posts') ) {
    $link = str_replace('Site Admin','Edit your Profile', $link);
    $link = str_replace('wp-admin/','wp-admin/profile.php', $link);
    return $link;

    Thank you alchymyth! 🙂

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Twenty Twelve] Adding elements to the right side of header image’ is closed to new replies.