Initial AI theme draft

This commit is contained in:
2026-07-26 16:56:32 +02:00
parent 56579bf158
commit 5542e72f98
16 changed files with 245 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
<?php
/** Theme functions for Commander 1024 2026. */
function c1024_2026_setup() {
load_theme_textdomain( 'c1024-2026', get_template_directory() . '/languages' );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'title-tag' );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'responsive-embeds' );
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_editor_style( 'editor-style.css' );
register_nav_menus( array(
'primary' => __( 'Primary menu', 'c1024-2026' ),
'footer' => __( 'Footer menu', 'c1024-2026' ),
) );
}
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 );
}
add_action( 'wp_enqueue_scripts', 'c1024_2026_assets' );
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_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_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' ) );
}
add_action( 'customize_register', 'c1024_2026_customize_register' );
function c1024_2026_excerpt_more( $more ) {
return '…';
}
add_filter( 'excerpt_more', 'c1024_2026_excerpt_more' );