主题开发文档

💡 云策文档标注

概述

本文档深入探讨 WordPress 主题开发的核心功能,涵盖从自定义头部到国际化等关键方面,旨在帮助开发者构建功能完整且用户友好的主题。

关键要点

  • 自定义头部:允许用户添加自定义头部图像
  • 侧边栏:添加可挂载小工具的区域
  • 小工具:创建可重用的 PHP 对象,用于侧边栏
  • 导航菜单:在主题中注册和显示菜单
  • 分类法模板:为分类存档页面创建模板
  • 分页:使用 WordPress 内置分页功能
  • 评论:自定义评论模板
  • 媒体:利用 WordPress 核心媒体功能
  • 特色图像和文章缩略图:处理和自定义文章缩略图
  • 文章格式:创建不同格式以显示用户文章
  • 国际化:准备主题以支持多语言翻译
  • 本地化:学习如何翻译 WordPress 主题
  • 无障碍性:遵循最佳实践确保主题可访问性
  • 管理菜单:向 WordPress 管理界面添加菜单项
  • 404 页面:创建自定义 404 页面

📄 原文内容

Now that you’re familiar with the basics of theme development, it’s time to start digging deeper into the world of themes. This section covers all of the basic theme functionality that you’ll need to consider while creating your theme:

  • Custom headers – learn how to give your users the flexibility of adding their own header image
  • Sidebars – add widgetized areas to your theme where users can add widgets
  • Widgets – create re-usable PHP objects that can be added to a sidebar
  • Navigation menus – register and display menus within your theme
  • Taxonomy Templates – create templates for your taxonomy archive pages
  • Pagination – work with WordPress’ built-in pagination
  • Comments – customize the comments template
  • Media – work with WordPress core’s media capabilities
  • Featured Images & Post Thumbnails – work with and customize post thumbnails
  • Post Formats – create different formats for displaying users’ posts
  • Internationalization – learn how to prepare your theme for translation into different languages
  • Localization – learn how to translate a WordPress theme
  • Accessibility – learn about accessibility best practices to ensure everyone can use your theme
  • Administration Menus – add menu items to the WordPress administration
  • 404 Pages – create a custom 404 page

If you’re new to themes it’s worth working your way through each section, but you can also jump into a section if you’re looking for something specific.