• Resolved sandra408

    (@sandra408)


    Hi.
    I added a widget for my header. But it stretches all the way across the top, so does not react to it’s size dimensions or a z-index position… Have no idea what I did wrong.

    Here is the functions.php file code:

    register_sidebar( array(
        'name' => __( 'Header Widget Area Left', 'My-Theme-Name' ),
        'id' => 'header-widget-area-left',
        'description' => __( 'The header left widget area', 'my-theme-name' ),
        'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
        'after_widget' => '</li>',
        'before_title' => '<h3 class="widget-title">',
        'after_title' => '</h3>',
    ) );

    Here is what I put in the header:

    <?php
    
    if ( is_active_sidebar( 'header-widget-area-left' )) {
    
    dynamic_sidebar( 'header-widget-area-left' );
    }
    ?>

    And here is CSS:

    #header-widget-area-left {
        float: left;
        position: absolute;
        width: 150px;
        height: 233px;
        z-index: 50;
    }

    Any ideas?

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • My-Theme-Name v. my-theme-name ?

    Thread Starter sandra408

    (@sandra408)

    I resolved it by putting php code in <div> tags and giving <div> an id …

    Here is CSS:

    #header-left-widget-holder {
        height: 233px;
        width: 150px;
        margin: 23px 0 40px 40px;
        position: absolute;
        z-index: 50;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom header widget size problem…’ is closed to new replies.