WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] HEADER_TEXTCOLOR not changeable (5 posts)

  1. Alexander Hoereth
    Member
    Posted 3 years ago #

    Hey there,
    I am creating a twentyten childtheme atm.
    Problem: I dont get the changeable header textcolor working.

    define( 'HEADER_TEXTCOLOR', 'ffffff' );
    	define( 'NO_HEADER_TEXT', false );

    These work just fine. I get access to the needed form to change header textcolor in the wordpress administration menu, but changing the color does not change the HEADER_TEXTCOLOR constant. If i echo it it still says ffffff.

    Whats wrong? I already printed all constants used in my wp installation and searched them for different color constants - didnt find any.

    help please

  2. Michelle Langston
    Theme Wrangler at Automattic
    Posted 3 years ago #

    Well if you define it as 'fffff' it will stay that way, right? Since it's a constant? Once a constant is defined, I don't think it can change. Just remove the 'ffffff' in the definition and do it like this:

    define( 'HEADER_TEXTCOLOR', '' );

  3. Alexander Hoereth
    Member
    Posted 3 years ago #

    tried that already. stays empty if empty before..

  4. esmi
    Forum Moderator
    Posted 3 years ago #

    Once a constant is defined, I don't think it can change.

    Correct but there is a way around it. Ideally, TwentyTen should be using something like:

    define('HEADER_TEXTCOLOR', apply_filters( 'twentyten_header_color', '' ) );

    Then the child theme could use:

    function child_header_textcolor($color) {
        $color = 'fff';
        return $color;
    }
    add_filter( 'child_header_textcolor', 'child_header_textcolor' );
  5. Alexander Hoereth
    Member
    Posted 3 years ago #

    omg - i just found the (get_)header_textcolor() function. can not try it atm - but i think this is what i need. will change topic status later if it works

    http://codex.wordpress.org/Function_Reference/header_textcolor
    http://codex.wordpress.org/Function_Reference/get_header_textcolor

Topic Closed

This topic has been closed to new replies.

About this Topic