• rphanus

    (@rphanus)


    Hello guys..
    I have a bit of struggle to change the color in the header. I like to have a “Customising
    Colours” in the customizer.

    Here is some code I tried to use, but no luck:
    inc/customizer.php
    //header-color
    $wp_customize->add_control(
    new WP_Customize_Control(
    $wp_customize,
    ‘understrap_header_color’, array(
    ‘label’ => __( ‘Header Color’, ‘understrap’ ),
    ‘description’ => __( “Choose the color behind the logo and navigation”, ‘understrap’ ),
    ‘section’ => ‘colors’,
    ‘settings’ => ‘understrap_header_color’,
    ‘type’ => ‘color’,
    ‘default’ => ‘#0098ca’,
    ‘priority’ => ’30’,
    ‘transport’ => ‘refresh’,
    )
    ) );

    and this code also….:

    function my_add_header_support() {

    $chargs = array(
    ‘width’ => 980,
    ‘height’ => 60,
    ‘default-text-color’ => ”,
    ‘default-image’ => ”,
    ‘uploads’ => true,
    );
    add_theme_support( ‘custom-header’, $chargs );
    }
    add_action( ‘after_setup_theme’, ‘my_add_header_support’ );

    But it dosen’t work, I will guess there is a lot of faults…

Viewing 2 replies - 1 through 2 (of 2 total)
  • understrap

    (@holger1411)

    As far as I could see it its just the code to provide a input field in the theme customizer area to add a color code…
    You also need to add custom CSS code where the color code is outputted/used.
    for example like
    .navbar{background-color: $myvariable!;}

    Thread Starter rphanus

    (@rphanus)

    Thanks for quick respons Holger ??
    So when I will have a transparent header I write in my css:

    .navbar {
    background-color: transparent;
    }

    But it dosen’t work ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add color to header’ is closed to new replies.