Categories widget in theme by default, after activating.
-
This is code from my themes functions.php file. I want to add categories widget in here by default, so that the user won’t have to manually drag and drop categories widget to the sidebar inside admin widget page. How to do that? Thanks ??
function twentyeleven_widgets_init() { register_widget( 'Twenty_Eleven_Ephemera_Widget' ); register_sidebar(array( 'name' => 'Category Top', 'id' => 'sidebar-category-top', 'description' => __( 'Put here the widget category', 'twentyeleven' ), 'before_widget' => '<div class="category-top">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>', )); } add_action( 'widgets_init', 'twentyeleven_widgets_init' );
The end result should be: When user activates theme, he sees this when clicking widgets page.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Categories widget in theme by default, after activating.’ is closed to new replies.