Edit srcset and sizes attributes in Gutenberg image, cover and gallery – blocks

Try the suggestion below: This assumes the <figure> element holding an image has a data-display-alignment attribute to match the alignment class applied attached that is somehow surfaced as a parameter in the wp_calculate_image_sizes hook: /** * Add custom image sizes attribute to enhance responsive image functionality * for content images. * * @param string $sizes … Read more

Add a new checkbox in theme options

To answer the first part of your question: your settings form already has the checkbox case covered; so if you add a new checkbox input, you don’t need to add anything to the switch. This code will apply to all checkbox inputs you add: case ‘checkbox’: ?> <input type=”checkbox” name=”vertigo_theme_options[<?php echo esc_attr( $option[‘id’] ); ?>]” … Read more

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

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