Add default Backgrounds

There’s no default way to do that yet, though there is a Trac ticket. I found this (untested) that may work for you: http://www.devblog.fr/2011/05/16/plusieurs-fonds-personnalises-wordpress-add_custom_background/ It’s also worth noting the 3.4’s new way of defining a default background (still just one, though). Edit Here’s the code: <?php function wpse48332_setup_theme() { // Add support for custom backgrounds … Read more

Understanding wp_add_inline_style

wp_add_inline_style() is intended to add additional CSS to an existing stylesheet. The idea is that you may need to dynamically alter the stylesheet – for instance, you have user-selected colours associated with categories and you would like to colour each category’s title accordingly. You can’t hardcode this since the colours in question are not known, … Read more

Add a dropdown to theme customizer

Add Section to Theme Customizer: $wp_customize->add_section( ‘parsmizban_options’, array( ‘title’ => __( ‘Theme Options’, ‘parsmizban’ ), //Visible title of section ‘priority’ => 20, //Determines what order this appears in ‘capability’ => ‘edit_theme_options’, //Capability needed to tweak ‘description’ => __(‘Allows you to customize settings for Theme.’, ‘parsmizban’), //Descriptive tooltip ) ); Add new Setting: $wp_customize->add_setting( ‘bootstrap_theme_name’, //No … Read more

Assign single template to multiple custom post types?

You can filter template_include and pass your custom template as return value depending on your own conditions. Sample code, not tested: add_filter( ‘template_include’, function( $template ) { // your custom post types $my_types = array( ‘photography’, ‘painting’ ); $post_type = get_post_type(); if ( ! in_array( $post_type, $my_types ) ) return $template; return get_stylesheet_directory() . ‘/single-photography.php’; … Read more