Removing the default sidebar from admin panel

If you mean the default WordPress Widgets, you would add this to the functions.php file: <?php // unregister all default WP Widgets function unregister_default_wp_widgets() { unregister_widget(‘WP_Widget_Pages’); unregister_widget(‘WP_Widget_Calendar’); unregister_widget(‘WP_Widget_Archives’); unregister_widget(‘WP_Widget_Links’); unregister_widget(‘WP_Widget_Meta’); unregister_widget(‘WP_Widget_Search’); unregister_widget(‘WP_Widget_Text’); unregister_widget(‘WP_Widget_Categories’); unregister_widget(‘WP_Widget_Recent_Posts’); unregister_widget(‘WP_Widget_Recent_Comments’); unregister_widget(‘WP_Widget_RSS’); unregister_widget(‘WP_Widget_Tag_Cloud’); unregister_widget(‘WP_Nav_Menu_Widget’); } add_action(‘widgets_init’, ‘unregister_default_wp_widgets’, 1); ?> EDIT: register_sidebar(array(‘name’=>’sidebar2’, ‘before_widget’ => ‘<ul><li>’, ‘after_widget’ => “</li></ul>”, ‘before_title’ => ‘<h2 class=”widgettitle”>’, … Read more

How do I get a parent theme modification from a child theme?

If you look at how the code works, you should notice that theme mods are saved in the *_options table under theme_mods_{theme_slug} with the theme slug being, as near as I can tell, the directory name containing the theme stylesheet, so: $ptheme = get_template_directory(); $theme_slug = basename($ptheme); $mods = get_option( “theme_mods_$theme_slug”); As a function: function … Read more

How can I add an incremental class identifier to my sidebar widgets?

There doesn’t seem to be an easy way to do this. However, you can try this rather hackish approach: add_filter(‘dynamic_sidebar_params’, ‘my_sidebar_params_cb’); function my_sidebar_params_cb($params) { global $my_widget_counter; if (empty($my_widget_counter)) $my_widget_counter = 1; else $my_widget_counter++; $params[0][‘before_widget’] = str_replace(‘class=”‘, ‘class=”widget_nr_’.$my_widget_counter.’ ‘, $params[0][‘before_widget’]); return $params; }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)