'my-custom-style', 'label' => 'My Custom Style', ) ); register_block_style( 'core/button', array( 'name' => 'fancy-button', 'label' => 'Fancy Button' ) ); register_block_pattern( 'bigshop/two-column-layout', array( 'title' => __( 'Two Column Layout', 'bigshop' ), 'description' => __( 'A two-column layout with a paragraph and an image.', 'bigshop' ), 'content' => "

Enter your text here

\"\"
", ) ); register_block_pattern( 'bigshop/wt-custom-pattern', array( 'title' => __('My Custom Pattern', 'bigshop'), 'description' => __('A description of my custom pattern.', 'bigshop'), 'content' => '

' . __('Some content', 'bigshop') . '

', ) ); } /** * Setup Theme * @return void */ public function setup() { load_theme_textdomain( 'bigshop', get_template_directory() . '/languages' ); $this->add_image_size(); add_action( 'admin_init', function() { add_editor_style( 'editor-style.css' ); // Ensure your editor styles file exists in the theme folder }); } /** * Add Image Size * @return void */ private function add_image_size() { $sizes = [ 'wtbigshop-size1' => [ 1115, 560, true ], 'wtbigshop-size2' => [ 960, 520, true ], 'wtbigshop-size3' => [ 550, 375, true ], ]; $sizes = apply_filters( 'wtbigshop_image_size', $sizes ); foreach ( $sizes as $size => $value ) { add_image_size( $size, $value[0], $value[1], $value[2] ); } } /** * Add Theme Support * @return void */ private function add_theme_support() { /* * Default Theme Support options better have */ add_theme_support( 'automatic-feed-links' ); add_theme_support( 'title-tag' ); add_theme_support( 'post-thumbnails' ); add_theme_support( 'customize-selective-refresh-widgets' ); add_theme_support( 'align-wide' ); add_theme_support( 'html5', [ 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption' ] ); add_theme_support( 'wp-block-styles' ); add_theme_support( 'editor-styles' ); add_theme_support( 'custom-logo' ); add_theme_support( "custom-header" ); add_theme_support( "custom-background" ); add_theme_support('responsive-embeds'); remove_theme_support('widgets-block-editor'); /** * Add woocommerce support and woocommerce override */ /* * Activate Post formats if you need */ add_theme_support( 'post-formats', [ 'aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat', ] ); } /* Define a max content width to allow WordPress to properly resize your images */ public function content_width() { $GLOBALS['content_width'] = apply_filters( 'content_width', 1440 ); } }