Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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 :)

share|improve this question
    
Have a look at the twentyfourteen theme how custom header is used and implemented in the theme. –  Pieter Goosen May 12 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 May 12 at 18:01

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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