跳转到主要内容

书籍

WordPress 主题手册

WordPress 主题手册,介绍主题结构、模板、样式与发布流程。

134 页更新于 1 天前

开始阅读

目录134

  1. 01 Advanced Topics Welcome to the advanced theme topics documentation. In this chapter, you will learn about some of the more ... 1 天前
  2. 02 Core Concepts Welcome to the Core Concepts documentation. The goal of this chapter is to introduce you to the foundationa... 1 天前
  3. 03 Credits @ancawonka @Anthonynotes @atachibana @austingunter @bandonrandon @utz119 @BFTrick @BigActual @bkozma @bobor... 1 天前
  4. 04 Features Welcome to the Features documentation. In this chapter, you will learn about various features supported by ... 1 天前
  5. 05 Getting Started Welcome to the Getting Started documentation. This chapter is primarily intended to introduce you to naviga... 1 天前
  6. 06 Global Settings and Styles (theme.json) Welcome to the Global Settings and Styles documentation. In this chapter you will learn everything you need... 1 天前
  7. 07 Theme Handbook Welcome to the WordPress Theme Developer Handbook, your resource for learning all about the exciting world ... 1 天前
  8. 08 Patterns Patterns are one of the most useful tools for theme development, allowing you to reuse groups of blocks acr... 1 天前
  9. 09 Releasing Your Theme This section covers the requirements and submission process for releasing your theme into the WordPress The... 1 天前
  10. 10 Templates Welcome to the Templates documentation. In this chapter you will learn how the WordPress block template sys... 1 天前
  11. 11 Build Process A build process is a method of converting source code files into a final build/production version that can ... 1 天前
  12. 12 Debugging Debugging is the practice of finding and fixing errors in any software that you build. And it is an essenti... 1 天前
  13. 13 Internationalization Internationalization is the process of developing your theme in such a way that its custom text can be tran... 1 天前
  14. 14 JavaScript Best Practices Many themes use JavaScript to provide interactivity, animation or other enhancements. These best practices ... 1 天前
  15. 15 Plugin API Hooks A theme should work well with WordPress plugins. Plugins add functionality by using actions and filters, wh... 1 天前
  16. 16 Privacy WordPress 4.9.6 introduced several tools to help sites meet the requirements of the European Union’s new GD... 1 天前
  17. 17 Testing Whether you are planning to share your WordPress theme with a broad audience or aiming for a specific platf... 1 天前
  18. 18 Theme Testing The Theme Unit Test data is a WordPress import file will fill a WordPress site with enough stub data (posts... 1 天前
  19. 19 UI Best Practices Logo Homepage Link The logo at the top each page should send the user to the homepage of your site. If you ... 1 天前
  20. 20 Theme Basics In this chapter, you’ll begin learning how to build a theme. The anatomy of a theme and its parts will be b... 1 天前
  21. 21 Theme Options – The Customize API The Customize API (Customizer) is a framework for live-previewing any change to WordPress. It provides a un... 1 天前
  22. 22 Theme Functionality Now that you’re familiar with the basics of theme development, it’s time to start digging deeper into the w... 1 天前
  23. 23 References This section contains lists of Template Tags and Conditional Tags. Template Tags are used in your Template ... 1 天前
  24. 24 Template Files We introduced template files earlier in the handbook.  This next section is going to break up the different... 2 个月前
  25. 25 Your First Theme Block Theme This section is for a block theme. Required Files The only files needed for a block theme is, i... 2 个月前
  26. 26 Categories, Tags, & Custom Taxonomies Categories, tags, and taxonomies are all related and can be easily confused. We’ll use the example of build... 2 个月前
  27. 27 Conditional Tags Conditional Tags can be used in your Template Files in classic themes to alter the display of content depen... 2 个月前
  28. 28 Including CSS & JavaScript (Archived) This is an old page that has been archived in favor of the newer Including Assets documentation in the Core... 2 个月前
  29. 29 Linking Theme Files & Directories Linking to Core Theme Files As you’ve learned, WordPress themes are built from a number of different templa... 2 个月前
  30. 30 Main Stylesheet (style.css) The style.css is a stylesheet (CSS) file required for every WordPress theme. It controls the presentation (... 2 个月前
  31. 31 Organizing Theme Files While WordPress themes technically only require two files ( index.php in classic themes and index.html in ... 2 个月前
  32. 32 Post Types There are many different types of content in WordPress. These content types are normally described as Post ... 2 个月前
  33. 33 Reworking Theme Files & Organization Theme folder and file structure While WordPress themes technically only require two files ( index.php and ... 2 个月前
  34. 34 Template Files Template files are used throughout WordPress themes, but first let’s learn about the terminology. Template ... 2 个月前
  35. 35 Template Hierarchy As discussed, template files are modular, reusable files, used to generate the web pages on your WordPress ... 2 个月前
  36. 36 Template Tags Template tags are used within themes to retrieve content from your database. The content could be anything ... 2 个月前
  37. 37 The Loop The Loop is the default mechanism WordPress uses for outputting posts through a theme’s template files. How... 2 个月前
  38. 38 Theme Functions Functions.php can be used by both classic themes, block themes, and child themes. The functions.php file i... 2 个月前
  39. 39 Tools & Resources Whether you’re building your very first theme or your tenth, the following resources are meant to help ease... 2 个月前
  40. 40 Advanced Usage The customize API is actively developed; this page contains additional more advanced topics. Additional dis... 2 个月前
  41. 41 Customizer Objects The Customize API is object-oriented. There are four main types of Customizer objects: Panels, Sections, Se... 2 个月前
  42. 42 JavaScript/Underscore.js-Rendered Custom Controls WordPress 4.1 also added support for rendering JavaScript-heavy and/or high-quantity controls entirely with... 2 个月前
  43. 43 The Customizer JavaScript API In WordPress 4.1, newly-expanded JavaScript APIs were introduced for all customizer objects. The entire Jav... 2 个月前
  44. 44 Tools for Improved User Experience Contextual Controls, Sections, and Panels WordPress 4.0 and 4.1 also added support for making parts of the ... 2 个月前
  45. 45 404 Pages A 404 page is important to add into your theme in case a user stumbles upon a page that doesn’t exist or ha... 2 个月前
  46. 46 Accessibility A WordPress theme should generate pages everyone can use, including those who cannot see or use a mouse. To... 2 个月前
  47. 47 Administration Menus This is no longer the recommended way to work with theme options. The Customizer API is the recommended way... 2 个月前
  48. 48 Block theme accessibility Block themes support accessibility and simplify the process for adding accessibility. Landmark Group, Templ... 2 个月前
  49. 49 Core-Supported Features This page will list and somewhat detail all core-supported features. Each feature will have its own page. 2 个月前
  50. 50 Custom Backgrounds Custom Backgrounds is a theme feature that provides for customization of the background color and image. Th... 2 个月前
  51. 51 Custom Front Page Templates By default, WordPress shows your most recent posts in reverse chronological order on the front page of your... 2 个月前
  52. 52 Custom Headers Custom Header Custom headers allow site owners to upload their own “title” image to their site, which can b... 2 个月前
  53. 53 Custom Logo What is a Custom Logo? Using a custom logo allows site owners to upload an image for their website, which c... 2 个月前
  54. 54 Featured Images & Post Thumbnails Featured images (also sometimes called Post Thumbnails) are images that represent an individual Post, Page,... 2 个月前
  55. 55 Internationalization What is internationalization? Internationalization is the process of developing your theme, so it can easil... 2 个月前
  56. 56 Localization What is localization? Localization describes the subsequent process of translating an internationalized the... 2 个月前
  57. 57 Media WordPress enables theme developers to customize the look, feel, and functionality of the platform’s core me... 2 个月前
  58. 58 Navigation Menus Navigation Menus are customizable menus in your theme. They allow users to add Pages, Posts, Categories, an... 2 个月前
  59. 59 Pagination Pagination allows your user to page back and forth through multiple pages of content. WordPress can use pag... 2 个月前
  60. 60 Post Formats A Post Format is used by a theme for presenting posts in a certain format and style. The Post Formats featu... 2 个月前
  61. 61 Sidebars What are Sidebars A sidebar is any widgetized area of your theme. Widget areas are places in your theme whe... 2 个月前
  62. 62 Sticky Posts A Sticky Post is the post will be placed at the top of the front page of posts. This feature is only availa... 2 个月前
  63. 63 Widgets A widget adds content and features to a widget area (also called a sidebar). Widget areas provide a way for... 2 个月前
  64. 64 Audio Audio You can directly embed audio files and play them back using a simple shortcode [audio]. Supported fil... 2 个月前
  65. 65 Galleries Galleries Image galleries are the best way to showcase your pictures on your WordPress sites. WordPress bun... 2 个月前
  66. 66 Images Images This section describes the handling of images in the Media Library. If you want to display the image... 2 个月前
  67. 67 Video Video The WordPress video feature allows you to embed video files and play them back using a simple shortco... 2 个月前
  68. 68 List of Conditional Tags Conditional Tags are a boolean data type that can be used in your Template Files to alter the display of co... 2 个月前
  69. 69 List of Template Tags Complete List of Template Tags Template tags files are stored in the wp-includes directory. The files have... 2 个月前
  70. 70 Attachment Template Files Attachments are a special post type that holds information about a file uploaded through the WordPress medi... 2 个月前
  71. 71 Custom Post Type Template Files The WordPress theme system supports custom templates for custom post types. Custom templates for the single... 2 个月前
  72. 72 Page Templates Page templates are a specific type of template file that can be applied to a specific page or groups of pag... 2 个月前
  73. 73 Partial and Miscellaneous Template Files Introduction Not all template files generate the entire content that will be rendered by the browser. Some ... 2 个月前
  74. 74 Post Template Files There are many template files that WordPress uses to display the Post post type. Any content dealing with a... 2 个月前
  75. 75 Taxonomy Templates When a visitor clicks on a hyperlink to category, tag or custom taxonomy, WordPress displays a page of post... 2 个月前
  76. 76 Comment Template WordPress displays comments in your theme based on the settings and code in the comments.php file within y... 2 个月前
  77. 77 Custom Functionality (functions.php) This document will introduce you to the functions.php file. It is one of the optional standard files you f... 2 个月前
  78. 78 Global Settings and Styles As you learned in Theme Structure, theme.json is a standard file that WordPress looks for in your theme. W... 2 个月前
  79. 79 Including Assets Many block themes do not need to load any assets. For design aspects, specifically, much of this can be han... 2 个月前
  80. 80 Main Stylesheet (style.css) As described in Theme Structure, WordPress requires that all themes include a style.css file. Its most imp... 2 个月前
  81. 81 Templates In block themes, templates are made up of a collection of blocks. You might have a Site Logo block sitting ... 2 个月前
  82. 82 Theme Structure In the Getting Started chapter, you learned the basics of what a theme is and how to get one up and running... 2 个月前
  83. 83 Feedback Giving Feedback We welcome suggestions to improve the article, whether it is to add new topics or to rectif... 2 个月前
  84. 84 Block Patterns (Archived) This documentation article has now been archived and replaced with the newer Patterns chapter of the Theme ... 2 个月前
  85. 85 Block Style Variations Block style variations (block styles, for short) let you create alternate styles for individual blocks. Reg... 2 个月前
  86. 86 Block Stylesheets When styling blocks, you should always do so via the theme.json styles property if possible. This ensures ... 2 个月前
  87. 87 Block Variations The Block Variations API is a powerful feature that allows you to extend any registered blocks. Basically, ... 2 个月前
  88. 88 Quick-Start Guide The first step is always the hardest to take. Now that you’ve made it this far into the Getting Started cha... 2 个月前
  89. 89 Reading This Handbook The goal of this handbook is to walk you through the basics of modern WordPress theme development in its ea... 2 个月前
  90. 90 Tools and Setup In this document, you will learn about the tools that you will need to get off to a solid start when buildi... 2 个月前
  91. 91 What Is a Theme? A WordPress theme represents the design of your website. It can control everything from colors, to fonts, t... 2 个月前
  92. 92 Who Is This Handbook For? The Theme Developer Handbook is a self-contained resource to help you learn the fundamental principles of c... 2 个月前
  93. 93 Custom Templates WordPress lets you register custom templates in theme.json. More specifically, you can register single pos... 2 个月前
  94. 94 Introduction to theme.json theme.json is a configuration file that lets you define the global settings, styles, and more for your them... 2 个月前
  95. 95 Patterns The patterns property in theme.json lets you bundle patterns from the WordPress Pattern Directory with yo... 2 个月前
  96. 96 Settings The settings property in theme.json lets you configure a wide range of settings for a WordPress install. ... 2 个月前
  97. 97 Style Variations Unlike most things here in the Global Settings and Styles documentation, style variations are not things yo... 2 个月前
  98. 98 Styles The styles property in theme.json lets you configure settings at the global level, for individual element... 2 个月前
  99. 99 Template Parts Template parts are small sections (i.e., parts) that you can include in top-level templates. Following the ... 2 个月前
  100. 100 Appearance Tools settings.appearanceTools is a unique property in theme.json that behaves as a catchall for multiple other ... 2 个月前
  101. 101 Blocks Most settings in theme.json let you configure properties at the global level. This means that they apply t... 2 个月前
  102. 102 Border The settings.border property in theme.json gives you control over the global border settings for blocks i... 2 个月前
  103. 103 Color Color is one of the primary components of design. You can create a theme that is dark and moody, fun and li... 2 个月前
  104. 104 Custom The settings.custom property is unique among other settings in theme.json. As its name implies, it is a c... 2 个月前
  105. 105 Dimensions The settings.dimensions property in theme.json gives you control over the global dimensions settings for ... 2 个月前
  106. 106 Layout The settings.layout property in theme.json is an object that stores layout-related settings that you can ... 2 个月前
  107. 107 Lightbox settings.lightbox is a specific setting that you can enable for supported blocks. It enables a lightbox fea... 2 个月前
  108. 108 Position The settings.position property in theme.json gives you control over the global positioning settings for b... 2 个月前
  109. 109 Settings Reference The document is a reference to the available settings properties that you can configure via the settings o... 2 个月前
  110. 110 Shadow The settings.shadow property in theme.json currently lets you create custom shadow presets. As of WordPre... 2 个月前
  111. 111 Spacing Spacing is one of the most complex parts of web design. It involves combining things like margin, padding, ... 2 个月前
  112. 112 Typography Typography is a wide-ranging subject in web design, and no single piece of documentation could do it justic... 2 个月前
  113. 113 Use Root Padding Aware Alignments The settings.useRootPaddingAwareAlignments property can be one of the most confusing settings in theme.js... 2 个月前
  114. 114 Applying Styles Traditionally, theme authors would style everything from a stylesheet—and they still sometimes must. In mod... 2 个月前
  115. 115 Styles Reference This is a reference to the available style properties that you can apply to the root element (global), indi... 2 个月前
  116. 116 Using Presets In the theme.json Settings documentation, you learned how to register custom presets, such as a color pale... 2 个月前
  117. 117 Block Type Patterns One of the most useful capabilities of patterns is the ability to tie them directly to one or more block ty... 2 个月前
  118. 118 Introduction to Patterns Block patterns (“patterns,” for short) are one of the most powerful features at a theme author’s disposal. ... 2 个月前
  119. 119 Patterns and Block Locking The Block Locking API is a powerful set of features that lets you lock the behavior of blocks and how users... 2 个月前
  120. 120 Registering Patterns In Introduction to Patterns, you learned how to create patterns from the WordPress admin interface. Now it’... 2 个月前
  121. 121 Starter Patterns The WordPress block editor is powerful and can handle many different layouts and designs. However, when bui... 2 个月前
  122. 122 Usage in Templates When building themes, patterns are not merely reusable sections of blocks that users can add to their conte... 2 个月前
  123. 123 Using PHP in Patterns One of the biggest advantages of patterns over features like templates and template parts is that you can u... 2 个月前
  124. 124 Required Theme Files Block theme: See Create a Block Theme for building a block theme Classic themes must include the required t... 2 个月前
  125. 125 Submitting Your Theme to WordPress.org Before themes are added to the WordPress Theme Directory, they are closely reviewed by the Themes team to m... 2 个月前
  126. 126 Testing If you’ve followed this handbook, you’ll already have a good grasp on the testing required before submittin... 2 个月前
  127. 127 Theme Review Guidelines The WordPress Themes Team provides and maintains the theme review guidelines as part of their task as WordP... 2 个月前
  128. 128 Updating Your Theme There are two ways to update your theme, by uploading a Zip file or using subversion (SVN). Uploading a Zip... 2 个月前
  129. 129 Writing Documentation Documentation is important for themes as it provides a way for users to understand what a theme does and do... 2 个月前
  130. 130 Introduction to Templates Like nearly all content management systems, WordPress uses a templating system to handle the output of cont... 2 个月前
  131. 131 Template Hierarchy As covered in the Templates documentation, templates are reusable files that are used to generate the docum... 2 个月前
  132. 132 Template Parts Templates represent the top-level document structure for the front end of a website. But template parts rep... 2 个月前
  133. 133 Templates Templates are one of the most important aspects of theme development. They are files that you put together ... 2 个月前
  134. 134 Theme security issues Please do not report security issues with WordPress Core to the themes team. To report an issue with WordPr... 2 个月前