WordPress.org

Ready to get started?Download WordPress

Forums

How to Override twentytwelve_custom_header_setup in Twenty Twelve Child Theme (6 posts)

  1. Toby Cryns (@themightymo)
    Member
    Posted 1 year ago #

    I am trying to disable the Twenty Twelve header functionality in a child theme. What happens is if I uncheck the " Show header text with your image." box under "Appearance"->"Header", the theme injects a bunch of CSS into my header that hides the site title and description.

    I have tried variations of remove_action ('after_setup_theme','twentytwelve_custom_header_setup'); in my child theme's functions.php file to no avail.

    How can I disable the twentytwelve_custom_header_setup function from my child theme?

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    Sorry but I don't think you can. FWIW, I think this needs to be posted as a bug in the theme. In functions.php, the line:

    require( get_template_directory() . '/inc/custom-header.php' );

    makes it impossible to over-ride the custom header easily. If this was changed to:

    require( get_stylesheet_directory() . '/inc/custom-header.php' );

    you could over-ride it by creating an empty /inc/custom-header.php file in your child theme. Additionally, that line should be moved inside the twentytwelve_setup() function, in my opinion.

  3. Toby Cryns (@themightymo)
    Member
    Posted 1 year ago #

    @esmi, Thanks for the quick reply. Where would I post the bug? Here: http://core.trac.wordpress.org/report/26 ?

  4. esmi
    Forum Moderator
    Posted 1 year ago #

    A new ticket in Trac yes. I'd have a quick search and I can't see anything relating to this specific issue.

  5. Toby Cryns (@themightymo)
    Member
    Posted 1 year ago #

    @esmi - Thanks! I just submitted a ticket and included your fix in there.

  6. mathis@Tambour
    Member
    Posted 1 year ago #


Topic Closed

This topic has been closed to new replies.

About this Topic