Viewing 1 replies (of 1 total)
  • Thread Starter willi18

    (@willi18)

    Text-Correction:

    I need help !
    I want that the theme “twentyseventeen-child”-picture shall automatically
    adapt to the screen-size of the user (PC or Tablet or Smartphone). To get this I rote the function.php (in a child theme)

    /* Use flexible Headers – Info from
    https://codex.wordpress.org/Custom_Headers and
    https://codex.wordpress.org/Function_Reference/register_default-headers and
    https://developer.wordpress.org/reference/functions/register_default-headers/
    */

    register_default_headers( array(
    $args = array(
    ‘flex-width’ => true,
    ‘width’ => 980,
    ‘flex-height’ => true,
    ‘height’ => 200,
    ‘default-image’ => get_template_directory_uri() . ‘%2$s/images/header.jpg’,
    )));
    add_theme_support( ‘custom-header’, $args );

    and in the header.php (in the child-theme)

    ” height=”<?php echo get_custom_header()->height; ?>” width=”<?php echo get_custom_header()->width; ?>” alt=”” />

    The result: I get two pictures. One is fix size the other is fixed together with the menu. It would be very kind if anyone has an idea what’s wrong.
    Thanks a lot
    Willi

Viewing 1 replies (of 1 total)

The topic ‘Use flexible headers’ is closed to new replies.