• Have been using WordPress for years and creating custom themes. I like to create custom sidebars when needed by using the register_sidebar function.

    I’ve always wondered why there isn’t an option to wrap the Widget’s content with something. Similar to what can be done with wrapping the entire widget or wrapping just the widget title. Add the ability to wrap just the contents and not the entire widget (title and all).
    Feature request:
    Add an argument for “before_widget_content” and “after_widget_content”.

    register_sidebar(array('name'=>'Sidebar',
    'id' => 'custom-sidebar',
    'description' => 'This controls the sidebar',
    'before_widget' => '<div id="widget" class="%2$s">',
    'after_widget' => '</div>',
    'before_title' => '<div class="widget-title">',
    'after_title' => '</div>',
    'before_widget_content' => '<div class="this-would-be-nice">',
    'after_widget_content' => '</div>'

    I’ve tried to add something after title and after widget, and also found some other work-arounds for text widgets specifically, but there can be an issue if title is empty or with default title because it is seen as empty.

    Seems like it would be an easy feature to add. But maybe more difficult than I think.
    Thanks.

  • The topic ‘Add Argument option to the register sidebar function’ is closed to new replies.