0

I changed the theme of my website this weekend but did not see that it wasn't supporting headers...

I am now trying to create the get header image function manually, I managed to do someting in the functions.php section but I do not really know what I should do in the header.php section.

When I try to put some code in the header.php my header appears on the top of the website container, above the logo.

What I would like is having a full width header that replaces all the white background above the menu, and with the logo and the news ticker visible on it.

Could anyone help me?

Thank you in advance :)

2
  • Have a look at the twentyfourteen theme how custom header is used and implemented in the theme. Commented May 12, 2014 at 17:04
  • You are gong to have to post the relevant code to get help, but honestly I'd be very afraid of a theme that doesn't use basics like get_header().
    – s_ha_dum
    Commented May 12, 2014 at 18:01

1 Answer 1

0

This code adds theme support for custom headers which adds a new page under Appearance in the wp dashboard.

function themes_custom_header_setup() {

add_theme_support( 'custom-header', $defaults, array(
    'default-text-color'     => 'fff',
    'width'                  => 1260,
    'height'                 => 240,
    'flex-height'            => true,
    'wp-head-callback'       => 'themes_header_style',
    'admin-head-callback'    => 'themes_admin_header_style',
    'admin-preview-callback' => 'themes_admin_header_image',
) ) );
}
add_action( 'after_setup_theme', 'themes_custom_header_setup' );

You can add/remove default arguments in the above code.

Source http://codex.wordpress.org/Function_Reference/add_theme_support

Then you can look in the header.php file of a theme like Twenty Fourteen to see how its coded.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.