__('Primary Menu', 'bones7456'), )); // Load theme textdomain load_theme_textdomain('bones7456', get_template_directory() . '/languages'); } add_action('after_setup_theme', 'bones7456_setup'); // Register sidebars function bones7456_widgets_init() { register_sidebar(array( 'name' => __('Sidebar', 'bones7456'), 'id' => 'sidebar-1', 'description' => __('Add widgets here to appear in your sidebar.', 'bones7456'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } add_action('widgets_init', 'bones7456_widgets_init'); // Enqueue scripts and styles function bones7456_scripts() { wp_enqueue_style('bones7456-style', get_stylesheet_uri(), array(), '1.35'); wp_enqueue_script('bones7456-script', get_template_directory_uri() . '/js/float_fix.js', array(), '1.35', true); if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } } add_action('wp_enqueue_scripts', 'bones7456_scripts'); // Add editor styles function bones7456_editor_styles() { add_editor_style(); } add_action('after_setup_theme', 'bones7456_editor_styles'); // Register block styles function bones7456_register_block_styles() { // Register button block style register_block_style( 'core/button', array( 'name' => 'bones7456-button', 'label' => __('Bones7456 Style', 'bones7456'), ) ); // Register quote block style register_block_style( 'core/quote', array( 'name' => 'bones7456-quote', 'label' => __('Bones7456 Quote', 'bones7456'), ) ); } add_action('init', 'bones7456_register_block_styles'); // Register block patterns function bones7456_register_block_patterns() { register_block_pattern( 'bones7456/hero-section', array( 'title' => __('Hero Section', 'bones7456'), 'description' => __('A hero section with title and description', 'bones7456'), 'content' => '

Welcome to Bones7456

A modern WordPress theme optimized for Chinese content

', 'categories' => array('featured'), ) ); } add_action('init', 'bones7456_register_block_patterns'); // Legacy comments support add_filter('comments_template', 'bones7456_legacy_comments'); function bones7456_legacy_comments($file) { if (!function_exists('wp_list_comments')) { $file = get_template_directory() . '/legacy.comments.php'; } return $file; } // Custom comment callback function bones7456_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?>
  • id="comment-">

    > %s 在 %s 说:', 'bones7456'), get_comment_author_link(), get_comment_date('Y年m月d日 H:i')); ?>【 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'], 'reply_text' => __('回复', 'bones7456')))) ?> 】

    comment_approved == '0') : ?>