• Resolved urbanrich

    (@urbanrich)


    I have added a widget area to my header by following a tutorial found here

    http://stackoverflow.com/questions/15497201/how-to-add-widget-to-the-header-php-in-wordpress

    This works fine, but I’m trying to find out if and how it’s possible to move the widget area to the right of the page, as at the moment the widget I’m using in the header is centered. I don’t really know coding, but I’m presuming that the widget is being aligned to the center due to where the widget area is, and not the widget itself, because looking at screenshots of the widget, it should be positioned to the right of the page.

    I’d really appreciate any help with this. Thanks.

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

    (@alchymyth)

    wrap the code into some html tags (div or span) with a specific CSS class and apply some formatting;

    example for the html code (reworked the code form your tutorial):

    <?php if ( is_active_sidebar( 'sidebar-2' ) { ?><div class="header-widget-area"><?php dynamic_sidebar('sidebar-2'); ?></div><?php } ?>

    the formatting in this example would be for .header-widget-area, possibly including some fixed width and float: right; details depend on your existing theme.

    PS:
    if you definitively only have one header widget, you can just try to use formatting for .headwidget – width, float, etc….

    Thread Starter urbanrich

    (@urbanrich)

    I’ve done it! Thank you, I appreciate you taking your time to help. 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Move header widget area to right side’ is closed to new replies.