Page template in two level deep folder

WordPress will only search one level deep (*See below for details) from the root directory of the theme for page (and post) templates. However, the array of templates can be filtered using the theme_{$post_type}_templates filter, so you can add deeply nested templates on your own: // See WP_Theme::get_page_templates /** * Filters list of page templates … Read more

Proper, exhaustive documentation for wp.editor etc

I have gone through the implementation of all Gutenberg core blocks in start, so now if I have to know how to use something then I first find the closest core component which is implementing that and then looks at the documentation of that particular block via https://github.com/WordPress/gutenberg/tree/master/packages/block-library/src This process is solving problems for me … Read more

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