true, 'flex-height' => true, ) ); add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', 'style', 'script' ) ); add_theme_support( 'align-wide' ); add_theme_support( 'editor-styles' ); // Classic-editor stylesheet; the same file is explicitly enqueued for the block editor below. add_editor_style( 'editor-style.css' ); register_nav_menus( array( 'primary' => __( 'Primary menu', 'c1024-2026' ), 'footer' => __( 'Footer menu', 'c1024-2026' ), ) ); } // Register theme capabilities before WordPress initializes theme-dependent features. add_action( 'after_setup_theme', 'c1024_2026_setup' ); function c1024_2026_assets() { wp_enqueue_style( 'c1024-2026-style', get_stylesheet_uri(), array(), '1.0.0' ); wp_enqueue_script( 'c1024-2026-theme', get_template_directory_uri() . '/assets/js/theme.js', array(), '1.0.0', true ); } // Load public assets through WordPress so dependencies and plugin integrations remain ordered. add_action( 'wp_enqueue_scripts', 'c1024_2026_assets' ); /** * Keep W3 Total Cache from converting every image into a JavaScript-only placeholder. * * Native browser lazy loading can still be enabled elsewhere, but W3TC's output-buffer * mutator removes `src` entirely and therefore prevents images from working without JS. */ function c1024_2026_disable_w3tc_javascript_lazyload( $can_process ) { $can_process['enabled'] = false; $can_process['reason'] = 'Commander1024 theme preserves non-JavaScript image delivery'; return $can_process; } add_filter( 'w3tc_lazyload_can_process', 'c1024_2026_disable_w3tc_javascript_lazyload' ); function c1024_2026_block_editor_assets() { // Load the complete canvas stylesheet inside Gutenberg's editor iframe. wp_enqueue_style( 'c1024-2026-editor-style', get_theme_file_uri( '/editor-style.css' ), array(), '1.0.0' ); } add_action( 'enqueue_block_editor_assets', 'c1024_2026_block_editor_assets' ); /** Register the three sitewide widget columns rendered above the footer. */ function c1024_2026_widgets_init() { for ( $column = 1; $column <= 3; $column++ ) { register_sidebar( array( 'name' => sprintf( __( 'Footer column %d', 'c1024-2026' ), $column ), 'id' => 'footer-' . $column, 'description' => __( 'Widgets displayed above the site footer on every page.', 'c1024-2026' ), 'before_widget' => '', 'before_title' => '