. // */ // add_theme_support( 'automatic-feed-links' ); // /** // * Enable support for post thumbnails and featured images. // */ // add_theme_support( 'post-thumbnails' ); // /** // * Add support for two custom navigation menus. // */ // register_nav_menus( array( // 'primary' => __( 'Primary Menu', 'transsocial-theme' ), // 'secondary' => __( 'Secondary Menu', 'transsocial-theme' ), // ) ); // /** // * Enable support for the following post formats: // * aside, gallery, quote, image, and video // */ // add_theme_support( 'post-formats', array( 'aside', 'gallery', 'quote', 'image', 'video' ) ); $styled_blocks = ['post-title']; foreach ($styled_blocks as $block_name) { $args = array( 'handle' => "myfirsttheme-$block_name", 'src' => get_theme_file_uri("assets/css/blocks/$block_name.css"), $args['path'] = get_theme_file_path("assets/css/blocks/$block_name.css"), ); wp_enqueue_block_style("core/$block_name", $args); } add_theme_support('align-wide'); // Add support for block styles. // add_filter('render_block', function ($blockContent, $block) { // if ($block['blockName'] !== 'core/post-title') { // return $blockContent; // } // $pattern = '/(]*>)(.*)(<\/h[1-7]{1}>)/i'; // $replacement = '$1$2$3'; // return preg_replace($pattern, $replacement, $blockContent); // }, 10, 2); } endif; // transsocialtheme_setup add_action('after_setup_theme', 'transsocialtheme_setup'); if (!function_exists('transsocialtheme_enqueue')) : function transsocialtheme_enqueue() { wp_enqueue_style('style', get_stylesheet_uri()); } endif; add_action('wp_enqueue_scripts', 'transsocialtheme_enqueue');