From 243fb51770abe7051d617ba03bb293634202c1e3 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Mon, 27 Jul 2026 12:34:55 +0200 Subject: [PATCH] Enhance Theme Templates and Editor Layout --- 404.php | 14 +++++-- archive.php | 20 ++++++++-- comments.php | 20 +++++++--- editor-style.css | 19 +++++++++- footer.php | 17 +++++++-- front-page.php | 70 +++++++++++++++++++++++++++------- functions.php | 77 +++++++++++++++++++++++++++++--------- header.php | 52 ++++++++++++++++++++++--- index.php | 26 +++++++++++-- page.php | 24 +++++++++++- search.php | 30 ++++++++++++--- searchform.php | 9 ++++- single.php | 62 +++++++++++++++++++++++------- template-parts/content.php | 24 +++++++++--- 14 files changed, 382 insertions(+), 82 deletions(-) diff --git a/404.php b/404.php index eb17d9b..8095fe1 100644 --- a/404.php +++ b/404.php @@ -1,4 +1,12 @@ - -

+ +
+

+

+

+ +

+
- -
1 ) ); } ?>
+ +
+ 1 ) ); + } + ?> +

-
    'ol', 'short_ping' => true, 'avatar_size' => 44, 'callback' => 'c1024_2026_comment' ) ); ?>
+
    + 'ol', 'short_ping' => true, 'avatar_size' => 44, 'callback' => 'c1024_2026_comment' ) ); ?> +
-

- + + +

+ + +
diff --git a/editor-style.css b/editor-style.css index cc69125..42e998b 100644 --- a/editor-style.css +++ b/editor-style.css @@ -44,7 +44,8 @@ /* Match the frontend's light canvas. The admin chrome is intentionally untouched. */ body.editor-styles-wrapper { - max-width: 760px; + /* The canvas may be wide; theme.json constrains normal blocks to contentSize. */ + max-width: var(--wp--style--global--wide-size, 1180px); padding: 2rem; margin: 0 auto; background: #f8f5f0; @@ -86,10 +87,24 @@ body.editor-styles-wrapper { /* * theme.json supplies contentSize and wideSize to Gutenberg's root container. - * Do not override its alignment geometry here: it also handles full-width blocks + * Do not override block alignment geometry here: it also handles full-width blocks * in the editor sidebar and other constrained editor layouts. */ +/* The post-title control sits outside Gutenberg's root block container. */ +.editor-post-title, +.editor-post-title__block { + width: 100%; + max-width: var(--wp--style--global--wide-size, 1180px) !important; + margin-right: auto !important; + margin-left: auto !important; +} + +.editor-post-title__input { + width: 100%; + max-width: none !important; +} + .editor-styles-wrapper a { color: #c3480b; diff --git a/footer.php b/footer.php index 8ea720d..1dc2b0e 100644 --- a/footer.php +++ b/footer.php @@ -1,10 +1,21 @@ - + diff --git a/front-page.php b/front-page.php index 82701f6..ddab41e 100644 --- a/front-page.php +++ b/front-page.php @@ -1,21 +1,63 @@ - +
+ + + +
+ +
+ + +

+ + +

+ +
+
+ - -
- -

-
-
- 1 ) ); } } else { while ( have_posts() ) { the_post(); ?>
>
+ 1 ) ); + } + } else { + while ( have_posts() ) { + the_post(); + ?> +
> +
+
+
true, 'flex-height' => true ) ); - add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', 'style', 'script' ) ); + add_theme_support( + 'custom-logo', + array( + 'flex-width' => 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_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' ); @@ -36,19 +48,50 @@ add_action( 'enqueue_block_editor_assets', 'c1024_2026_block_editor_assets' ); // These settings drive the optional front-page hero without hard-coding media or copy. function c1024_2026_customize_register( $wp_customize ) { - $wp_customize->add_section( 'c1024_2026_home_hero', array( - 'title' => __( 'Home page video hero', 'c1024-2026' ), - 'description' => __( 'Displayed on the site front page.', 'c1024-2026' ), - 'priority' => 30, - ) ); + $wp_customize->add_section( + 'c1024_2026_home_hero', + array( + 'title' => __( 'Home page video hero', 'c1024-2026' ), + 'description' => __( 'Displayed on the site front page.', 'c1024-2026' ), + 'priority' => 30, + ) + ); $wp_customize->add_setting( 'c1024_2026_hero_video', array( 'sanitize_callback' => 'absint' ) ); - $wp_customize->add_control( new WP_Customize_Media_Control( $wp_customize, 'c1024_2026_hero_video', array( - 'label' => __( 'Hero video', 'c1024-2026' ), 'section' => 'c1024_2026_home_hero', 'mime_type' => 'video', - ) ) ); - $wp_customize->add_setting( 'c1024_2026_hero_title', array( 'default' => get_bloginfo( 'name' ), 'sanitize_callback' => 'sanitize_text_field' ) ); - $wp_customize->add_control( 'c1024_2026_hero_title', array( 'label' => __( 'Overlay heading', 'c1024-2026' ), 'section' => 'c1024_2026_home_hero', 'type' => 'text' ) ); + $wp_customize->add_control( + new WP_Customize_Media_Control( + $wp_customize, + 'c1024_2026_hero_video', + array( + 'label' => __( 'Hero video', 'c1024-2026' ), + 'section' => 'c1024_2026_home_hero', + 'mime_type' => 'video', + ) + ) + ); + $wp_customize->add_setting( + 'c1024_2026_hero_title', + array( + 'default' => get_bloginfo( 'name' ), + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + $wp_customize->add_control( + 'c1024_2026_hero_title', + array( + 'label' => __( 'Overlay heading', 'c1024-2026' ), + 'section' => 'c1024_2026_home_hero', + 'type' => 'text', + ) + ); $wp_customize->add_setting( 'c1024_2026_hero_text', array( 'sanitize_callback' => 'sanitize_textarea_field' ) ); - $wp_customize->add_control( 'c1024_2026_hero_text', array( 'label' => __( 'Overlay text', 'c1024-2026' ), 'section' => 'c1024_2026_home_hero', 'type' => 'textarea' ) ); + $wp_customize->add_control( + 'c1024_2026_hero_text', + array( + 'label' => __( 'Overlay text', 'c1024-2026' ), + 'section' => 'c1024_2026_home_hero', + 'type' => 'textarea', + ) + ); } // Customize controls are registered only while the Customizer API is available. add_action( 'customize_register', 'c1024_2026_customize_register' ); diff --git a/header.php b/header.php index 3e1e97e..c9906c9 100644 --- a/header.php +++ b/header.php @@ -22,15 +22,55 @@ wp_body_open(); ?> - +
- - + +
- + - + diff --git a/index.php b/index.php index 85f1172..3fb75e8 100644 --- a/index.php +++ b/index.php @@ -1,7 +1,27 @@
- - 1 ) ); } else { ?>

+ + + 1 ) ); + } else { + ?> +

+
-
>
', '' ); ?>
+ +
> +
+ ', '' ); ?> +
+
+ +
+
+
+ - -
1 ) ); } else { ?>

+ +
+ 1 ) ); + } else { + ?> +

+ + +
"> - + diff --git a/single.php b/single.php index 6f3c572..0104a86 100644 --- a/single.php +++ b/single.php @@ -1,17 +1,53 @@
- -
> -
', '' ); ?>
-
-
-
-
- - + +
> +
+ + ', '' ); ?> + +
+ +
+ +
+ +
+ +
+
+ + + +
+
+
" >
- + ', esc_url( get_permalink() ) ), '' ); ?> -
+ +
+
- + + +