Compatability of gutenberg block in older WordPress version

I’m not sure that component is meant to be used on the front end, it looks as though that’s mainly there for creating buttons in the editor itself. For block “variations”, there are block styles, which might be what you’re looking for: https://developer.wordpress.org/block-editor/reference-guides/block-api/block-styles/. Block styles are the native way of having multiple ways of presenting … Read more

WordPress Gutenberg Columns block

All of the WP 5.x Core blocks are in a file called block-library.js. However, because the blocks all require a build step, you won’t be able to just copy the JS and start making edits. You’ll need to have Node.js and NPM installed. So, to get this all set up: Go to the Node JS … Read more

Gutenberg Reusable Block of WordPress

This is the way it worked for me: $post = get_post( $post_id ); if ( has_blocks( $post->post_content ) ) { $blocks = parse_blocks( $post->post_content ); foreach ( $blocks as $block ) { if ( isset( $block[‘attrs’][‘id’] ) ) { echo $block[‘attrs’][‘id’]; } elseif ( ‘core/block’ === $block[‘blockName’] ) { $block_content = parse_blocks( get_post( $block[‘attrs’][‘ref’] )->post_content … Read more

Change default colors in paragraph block settings

Rather than adjusting the default palette, you can define (and enforce) a custom palette. <?php // Add a custom palette add_action( ‘after_setup_theme’, ‘wpse_block_color_palette’ ); function wpse_block_color_palette() { add_theme_support( // Define the colors ‘editor-color-palette’, array( // First color – black array( ‘name’ => esc_html__( ‘Black’, ‘textdomain’ ), ‘slug’ => ‘black’, ‘color’ => ‘#2a2a2a’, ), // Second … Read more

Group block without inner wrapper

I did this in the function.php of my theme and it worked like a charm. Note: I am only missing the id, maybe someone can share a solution for that too. function custom_render_block_core_group ( string $block_content, array $block ): string { if ( $block[‘blockName’] === ‘core/group’ && !is_admin() && !wp_is_json_request() ) { $html=””; $tag = … Read more

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