How to add php stylesheet to admin section instead of admin_head hook

If you enqueue your style sheet first you should be able to use wp_add_inline_style afterwards. function custom_style() { wp_enqueue_style(‘your_css’, plugin_dir_url( __FILE__ ) . ‘style/your_css.css’ ); $bg_color = get_option(‘custom_color’); $custom_css = ” body { background-color: {$bg_color}; }”; wp_add_inline_style( ‘your_css’, $custom_css ); } This is not tested (just written from mind) and I have never used it … Read more

WordPress plugin creating sidebar on the theme/page

You need to create a widget in your plugin. Once you have the widget, just drag and drop it into the side bar. This might help. http://www.wpbeginner.com/wp-tutorials/how-to-create-a-custom-wordpress-widget/ http://premium.wpmudev.org/blog/create-a-wordpress-widget/

Saving category as insert post

The array for post_category needs to be an array of integers, not a string, and that’s what you are getting from the $_POST[‘cat’] the way you have it written. Change the value in the option to the category id instead.