• My dashboard has disappeared after placing the following code into my functions.php file in Editor;

    add_theme_support( ‘custom-header’ );
    $defaults = array(
    ‘default-image’ => ”,
    ‘width’ => 0,
    ‘height’ => 0,
    ‘flex-height’ => false,
    ‘flex-width’ => false,
    ‘uploads’ => true,
    ‘random-default’ => false,
    ‘header-text’ => true,
    ‘default-text-color’ => ”,
    ‘wp-head-callback’ => ”,
    ‘admin-head-callback’ => ”,
    ‘admin-preview-callback’ => ”,
    );
    add_theme_support( ‘custom-header’, $defaults );

    Now when I try to login to dashboard I only see a white page with the above code at the top of the page.

    What must I do to correct things .. please note I am using a localhost MAMP Pro

    Thanks in advance

Viewing 7 replies - 1 through 7 (of 7 total)
  • Can you post the entirety of your theme’s functions.php to Pastebin and post the link here? Other than the lack of the PHP opening tag, none of your code looks particularly problematic.

    Hi Tieran,

    You should post your code wrapped inside a function like this:

    function themename_custom_header_setup() {
        $args = array(
           'default-image' => '',
           'width' => 0,
           'height' => 0,
           'flex-height' => false,
           'flex-width' => false,
           'uploads' => true,
           'random-default' => false,
           'header-text' => true,
           'default-text-color' => '',
           'wp-head-callback' => '',
           'admin-head-callback' => '',
           'admin-preview-callback' => '',
       );
        add_theme_support( 'custom-header', $args );
    }
    add_action( 'after_setup_theme', 'themename_custom_header_setup' );

    Let me know if this works. 🙂

    Regards,
    Hardeep

    Thread Starter Tieran

    (@tieran)

    HI Stephen & Hardeep

    Thank you for your replies

    @ Stephen I can’t seem to find the functions.php file .. after searching for it I found about 10 such files and opened each of them with text editor but none of them seem to be the file that I added code to.

    I added the code from the Dashboard Editor .. would I still expect to find the file on my computer if using a localhost ? If so do you have any suggestions as to where I might find the file ?

    Thanks in advance

    Tieran

    What theme are you using? The file you edited is (likely) located at wordpress/wp-content/themes/your-theme-folder/functions.php, but the full location would depend on how you installed MAMP.

    You could copy the text directly from the built-in editor, though, and then paste it to Pastebin.

    Thread Starter Tieran

    (@tieran)

    Im using Health Medical theme

    http://themeforest.net/item/health-medical-wordpress-theme-for-medicine/9452706?WT.oss_phrase=&WT.oss_rank=9&WT.z_author=madza&WT.ac=search_list

    The function.php at that location (pastbin link below) does not appear to contain the code that I added

    http://pastebin.com/csPEUHXR

    Thread Starter Tieran

    (@tieran)

    unfortunately I can’t copy the text directly from the built-in editor, as the dashboard is inaccessible >> each time I try to log into dashboard I get a white page with the following text at the top;

    add_theme_support( ‘custom-header’ ); $defaults = array( ‘default-image’ => ”, ‘random-default’ => false, ‘width’ => 0, ‘height’ => 0, ‘flex-height’ => false, ‘flex-width’ => false, ‘default-text-color’ => ”, ‘header-text’ => true, ‘uploads’ => true, ‘wp-head-callback’ => ”, ‘admin-head-callback’ => ”, ‘admin-preview-callback’ => ”, ); add_theme_support( ‘custom-header’, $defaults );

    Do you remember exactly which file you originally edited? Alternatively, if you know where you have WordPress installed on your computer, you could try redownloading WordPress and then replacing all of the files in your WP installation except for wp-config.php and your wp-content/ folder. As long as you don’t disturb the wp-content/ folder, you won’t lose any of your downloaded themes, anything that you’ve uploaded to your media library, or any posts you’ve made.

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

The topic ‘add_theme_support( 'custom-header' );’ is closed to new replies.