• Resolved JetlagStudio

    (@alikisouma)


    Hi,

    I am facing this issue:

    I created a custom widget area in my functions.php file and then I called the widget in the header.php file:

    Finally, I stylized the widget in the custom.css area:

    .lang-item {
    
        position: relative;
    
        display: inline;
    
        top: 10px;
    
        left: 50%;

    Right now the flags are in the middle of the page. I am trying to place them on top of the logo.

    For some reason, when I place the flags in the middle of the page, they stay in the middle, as they should, but when I am trying to change the “left” attribute to 30%, the flags change position according to the width of the browser, as shown in the caption below:

    http://img255.imageshack.us/img255/9340/51185452.jpg

    How is it possible to make the flags stay on top of the logo no matter what?

    Any suggestions are appreciated,

    http://www.opensolution.gr

    PS. The translation plugin that I am using is Polylang.

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

    (@alchymyth)

    your code is causing validation errors: http://validator.w3.org/check?uri=http%3A%2F%2Fwww.opensolution.gr%2F&charset=%28detect+automatically%29&doctype=Inline&group=0

    http://codex.wordpress.org/Validating_a_Website

    move the new code to a location after the <body> tag, possibly to just after the outermost div .main-wrapper.

    your new ‘sidebar’ outputs li tags without surrounding ul tags;
    therefore either change the register code, for instance to:

    register_sidebar( array(
       'name' => __( 'header-widget'),
       'id' => 'mycustomwidgetarea',
       'description' => __( 'An optional widget area for your site footer', 'twentyeleven' ),
       'before_widget' => '<div id="%1$s" class="widget-container %2$s">',
       'after_widget' =>  '</div>',
       'before_title' => '<h3 class="widget-title">',
       'after_title' => '</h3>',
       ) );

    or change the ‘sidebar’ code, for instance to:

    <?php if( is_active_sidebar('mycustomwidgetarea') : ?>
    <ul><?php
    // Custom widget Area Start
    dynamic_sidebar('mycustomwidgetarea');
    // Custom widget Area End
    ?>
    </ul>
    <?php endif; ?>

    might need adjustments of the formatting.

    Thread Starter JetlagStudio

    (@alikisouma)

    Perfect, exactly what I needed. thank you very much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Issue with stylizing a custom widget area’ is closed to new replies.