• Resolved ericthelion

    (@ericthelion)


    Hi Group – my custom theme does not contain a “usual” sidebar – so I would like ot be able to drag and drop widgets into the center pane of my theme. (The theme is 2 column – static side bar on the left, then the content.)

    Should I be following this document ?
    http://codex.wordpress.org/Widgetizing_Themes

    It does not explain how to widgetize other areas other than the sidebar.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • well….widgetizing is widgetizing really…. things will differ theme by theme….but here’s a generic run through of how I add widget areas wherever I want them.

    first off, this goes in functions.php (between the <?php tags)

    register_sidebar(array(
    	'name'=>'widget1',
            'before_widget' => '<div id="%1$s" class="widget %2$s">',
            'after_widget' => '</div>',
            'before_title' => '<h3>',
            'after_title' => '</h3>',
        ));

    you can use the same code over and over (just change the widget1 name to a different name for each area)

    Thenk in your template (footer.php, index.php, header.php, etc) put this code where you want your new widget area to appear.

    <div class="widget1">
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('widget1') ) : ?>
    <?php endif; ?>
    </div>

    So now it’s registered, you can put a widget in it, and you have it on your template….but you gotta style it. That’s the part that is really theme specific…for instance, this worked fine for me:

    .widget1 {
            float: left;
            width: 340px;
            }

    but you’ll need to tweak it of course

    Thread Starter ericthelion

    (@ericthelion)

    Thanks a lot for posting this detail RVoodoo – I’ll go through the steps.

    Thread Starter ericthelion

    (@ericthelion)

    RVoodoo – your instructions very perfect.

    Thanks again.

    sweet! Glad ya got it!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Widget in center pane’ is closed to new replies.