主题开发文档

💡 云策文档标注

概述

本章介绍创建 WordPress 块主题所需的基础概念,包括主题结构、标准文件(如 style.css、functions.php 和 theme.json),旨在帮助开发者熟悉主题开发的基本框架。

关键要点

  • 主题结构:遵循 WordPress 标准的文件和文件夹组织方式。
  • 主样式表:style.css 文件的重要性及其使用方法。
  • 自定义功能:通过 functions.php 文件为主题添加自定义功能。
  • 模板:WordPress 块模板系统的工作原理及深入学习路径。
  • 资源引入:在主题中包含 CSS、JavaScript、图像等资源的指南。
  • 全局设置和样式:theme.json 文件的基本概述及其在主题中的作用。

📄 原文内容

Welcome to the Core Concepts documentation. The goal of this chapter is to introduce you to the foundational concepts necessary for creating your own WordPress block themes.

The focus of this chapter is to help you familiarize yourself with the basic theme structure and standard files like style.css, functions.php, and theme.json. Once you have these core concepts down, you can more comfortably dive into the later chapters in this handbook.

Navigating this chapter

Use the following links to locate a topic within this chapter. Each article is listed in the recommended reading order for those new to theme development. For those with existing experience creating themes, feel free to jump to the section you need:

  • Theme Structure: Walks through how a theme’s files and folders are structured following WordPress standards.
  • Main Stylesheet: Explains the importance of the theme’s style.css file and how to use it.
  • Custom Functionality: Dives into the theme’s functions file (functions.php) and how you can use it to add your own functionality to a theme.
  • Templates: Introduces how WordPress’ block templates system works and provides pathways for deeper learning.
  • Including Assets: A guide on including CSS, JavaScript, images, and more in your themes.
  • Global Settings and Styles: Gives a basic overview of how the theme.json file works in themes with learning pathways to more detailed articles.