Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Assigning default sidebar widgets


mark235
Participant

@mark235

Solved my own problem, here is correct code for assigning widgets for new blogs to all side bars:

<?php

function new_blogs_setting( $blog_id ) {

add_option( ‘widget_categories’,

array( ‘title’ => ‘My Categories’ ));

add_option(“sidebars_widgets”,

array(“sidebar-1” => array(“categories”),

“sidebar-2” => array(“tag_cloud”),

“sidebar-3” => array(“pages”, “links”),

“sidebar-4” => array(“archives”)));

}

add_action(‘populate_options’, ‘new_blogs_setting’);

?>

Skip to toolbar