WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am developing a WordPress theme and would like to make use of a custom header on a the homepage (I'm using a custom page template).

I would like this header to not include an image, but rather an <h1> and <h2> tag, and a link.

So my question is the following - how do I go about providing users with the facility to update the headings and the link in the header from the admin backend? Would add_theme_support( 'custom-header' ); be suitable for this since I need to add my own fields? And how would I go about completely disabling support for the image and showing the text in my page template?

share|improve this question
up vote 2 down vote accepted

File: functions.php

It's as easy as adding this to your functions.php file (of course having $wpse67109 set).

add_theme_support( 'custom-header', $wpse67109_defaults );

File: index.php or any other template

Simply don't add the whole get_head_image() and get_custom_header()->foo stuff anywhere.

Your headline template part could look like the following example:

        <h1 class="site-title">
            if ( display_header_text() )
                     '<a href="%s" title="%s" rel="home">%s</a>'
                    ,esc_url( home_url( '/' ) )
                    ,esc_attr( get_bloginfo( 'name', 'display' ) )
                    ,get_bloginfo( 'name' )
        <?php if ( '' !== get_bloginfo( 'description' ) ) : ?>
            <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
        <?php endif; ?>
share|improve this answer
Thank you for your reply. Ok, I'll give this a shot - just to clarify though, '$wpse67109_defaults' is the name of the array you used to set the settings for the custom header right? – Ian Muscat Oct 4 '12 at 11:52
@IanMuscat Right. I just prefix such stuff for questions in here. – kaiser Oct 4 '12 at 11:54
Ok. I'll give this a try soon. Thank you... – Ian Muscat Oct 4 '12 at 11:55
Hi, I tried out the example you provided me with - However I didn't get as far as I intended... While the code you gave above removes the image, I am still confused as to how I should insert my custom fields into the header area - I need to give the functionality to users to change the content that's in <h1> and <h2>. I found this tutorial - I'll give it a try and see where it takes me... – Ian Muscat Oct 4 '12 at 12:28
@IanMuscat What? Why? Nooo°°.... ! Just use the theme customizer with above code ↑. It's as easy as that. – kaiser Oct 4 '12 at 12:32

Your Answer


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.