2026-02-20 21:28:00 -05:00
|
|
|
<?php
|
|
|
|
|
/**
|
2026-02-20 22:06:53 -05:00
|
|
|
* Theme Setup - registers supports, menus, patterns, and editor styles.
|
2026-02-20 21:28:00 -05:00
|
|
|
*
|
|
|
|
|
* @package OTS_Theme
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ── Theme supports ────────────────────────────────────────── */
|
|
|
|
|
add_action( 'after_setup_theme', function () {
|
|
|
|
|
|
|
|
|
|
// FSE / block essentials
|
|
|
|
|
add_theme_support( 'wp-block-styles' );
|
|
|
|
|
add_theme_support( 'responsive-embeds' );
|
|
|
|
|
add_theme_support( 'editor-styles' );
|
|
|
|
|
|
|
|
|
|
// Classic fallback supports (still respected by block themes)
|
|
|
|
|
add_theme_support( 'automatic-feed-links' );
|
|
|
|
|
add_theme_support( 'title-tag' );
|
|
|
|
|
add_theme_support( 'post-thumbnails' );
|
|
|
|
|
add_theme_support( 'custom-logo', [
|
|
|
|
|
'height' => 40,
|
|
|
|
|
'width' => 180,
|
|
|
|
|
'flex-height' => true,
|
|
|
|
|
'flex-width' => true,
|
|
|
|
|
] );
|
|
|
|
|
add_theme_support( 'html5', [
|
|
|
|
|
'search-form',
|
|
|
|
|
'comment-form',
|
|
|
|
|
'comment-list',
|
|
|
|
|
'gallery',
|
|
|
|
|
'caption',
|
|
|
|
|
'style',
|
|
|
|
|
'script',
|
|
|
|
|
] );
|
|
|
|
|
|
|
|
|
|
// Load main.css inside the block editor so previews match the frontend
|
|
|
|
|
add_editor_style( 'assets/css/main.css' );
|
|
|
|
|
|
|
|
|
|
// Navigation menus (used by oribi/site-header block)
|
|
|
|
|
register_nav_menus( [
|
|
|
|
|
'primary' => __( 'Primary Menu', 'ots-theme' ),
|
|
|
|
|
'footer' => __( 'Footer Menu', 'ots-theme' ),
|
|
|
|
|
] );
|
|
|
|
|
} );
|
|
|
|
|
|
|
|
|
|
/* ── Block pattern categories ──────────────────────────────── */
|
|
|
|
|
add_action( 'init', function () {
|
|
|
|
|
register_block_pattern_category( 'oribi-pages', [
|
2026-02-20 22:06:53 -05:00
|
|
|
'label' => __( 'Oribi Tech - Pages', 'ots-theme' ),
|
2026-02-20 21:28:00 -05:00
|
|
|
] );
|
|
|
|
|
register_block_pattern_category( 'oribi-sections', [
|
2026-02-20 22:06:53 -05:00
|
|
|
'label' => __( 'Oribi Tech - Sections', 'ots-theme' ),
|
2026-02-20 21:28:00 -05:00
|
|
|
] );
|
|
|
|
|
} );
|
|
|
|
|
|
|
|
|
|
/* ── Remove core block patterns if desired ─────────────────── */
|
|
|
|
|
add_action( 'after_setup_theme', function () {
|
|
|
|
|
remove_theme_support( 'core-block-patterns' );
|
|
|
|
|
} );
|