• Resolved orsan

    (@orsan)


    I attempted to change Howdy to Welcome by putting the following code into function.php file.
    On save, I received a blank page and now cannot access the www.ads-software.com account or the site itself from outside.
    Very embarrassing!

    01 add_action( ‘admin_bar_menu’, ‘wp_admin_bar_my_custom_account_menu’, 11 );
    02
    03 function wp_admin_bar_my_custom_account_menu( $wp_admin_bar ) {
    04 $user_id = get_current_user_id();
    05 $current_user = wp_get_current_user();
    06 $profile_url = get_edit_profile_url( $user_id );
    07
    08 if ( 0 != $user_id ) {
    09 /* Add the “My Account” menu */
    10 $avatar = get_avatar( $user_id, 28 );
    11 $howdy = sprintf( __(‘Welcome, %1$s’), $current_user->display_name );
    12 $class = empty( $avatar ) ? ” : ‘with-avatar’;
    13
    14 $wp_admin_bar->add_menu( array(
    15 ‘id’ => ‘my-account’,
    16 ‘parent’ => ‘top-secondary’,
    17 ‘title’ => $howdy . $avatar,
    18 ‘href’ => $profile_url,
    19 ‘meta’ => array(
    20 ‘class’ => $class,
    21 ),
    22 ) );
    23
    24 }
    25 }

Viewing 6 replies - 1 through 6 (of 6 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    This was a core file?

    Thread Starter orsan

    (@orsan)

    Thanks for your response.
    Yes. I had tried putting the code into a child css file but it did not work.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Just trying to figure out which files I should recommend you replace. You probably know better than me. I’m basically going to tell you that you should replace the file with the original one. If it’s a core file, you can download WordPress again, extract the .zip format and find that core file.

    You need your hosting provider’s control panel to upload files. Your hosting providers should make a tool available to you that allows you to edit/ upload files. Something like “File Manager”.

    Thread Starter orsan

    (@orsan)

    OK. Since I canot go into Administration with WordPress, I assume that my only recourse is to contact my host bluehost.com

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Yes, Bluehost should have given you access to a ‘control panel’. If they haven’t then it’s best to contact them.

    Thread Starter orsan

    (@orsan)

    Thanks again for answering.
    I will mark this as resolved.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Attempted add to functions.php and locked out of wordpress by blank page’ is closed to new replies.