主题开发文档

💡 云策文档标注

概述

本章介绍构建 WordPress 主题的基础知识,包括主题结构、文件组织、The Loop 以及功能扩展方法。

关键要点

  • 理解主题的组成部分,如主题文件和文章类型。
  • 学习如何组织主题文件以保持结构清晰。
  • 掌握 The Loop 的作用,用于从 WordPress 数据库提取内容。
  • 通过主题函数添加功能,包括 CSS 和 JavaScript 集成。
  • 使用条件标签控制内容显示,并处理默认分类法和自定义分类法。

📄 原文内容

In this chapter, you’ll begin learning how to build a theme. The anatomy of a theme and its parts will be broken down and explained.

You’ll begin by understanding the concepts of building a theme by looking at theme files and post types. Then you’ll learn how to keep your files organized within your theme.

You’ll also look at The Loop, which is responsible for pulling content out of the WordPress database.

Finally, you’ll learn more about adding features to your theme by using theme functions, including CSS & JavaScript, leveraging conditional tags to only show content you need, and working with default taxonomies and creating your own.