Wordpress 中文
探索
首页
所有页面
社区页
交互式地图
最新博文
页面
最新页面
WordPress的安装过程
为WordPress寻找虚拟主机
使用SVN升级WordPress
First Steps With WordPress
管理留言面板
Introduction to Blogging
FAQ About WordPress
最新博客
分类
Getting Started
Backing Up Your Database
Database Description
FAQ About WordPress
FAQ Installation
FAQ New To WordPress
Importing Content
Podcasting
Troubleshooting
Backing Up Your Database
FAQ
FAQ About WordPress
FAQ Advanced Topics
FAQ Codex
FAQ Developer Documentation
FAQ Installation
社区
社区首页
社区中心
帮助中心
FANDOM
游戏
电影
电视
wiki
探索wiki
社区中心
创建wiki
尚未注册?
注册
登录
登录
注册
Wordpress 中文
145
个页面
探索
首页
所有页面
社区页
交互式地图
最新博文
页面
最新页面
WordPress的安装过程
为WordPress寻找虚拟主机
使用SVN升级WordPress
First Steps With WordPress
管理留言面板
Introduction to Blogging
FAQ About WordPress
最新博客
分类
Getting Started
Backing Up Your Database
Database Description
FAQ About WordPress
FAQ Installation
FAQ New To WordPress
Importing Content
Podcasting
Troubleshooting
Backing Up Your Database
FAQ
FAQ About WordPress
FAQ Advanced Topics
FAQ Codex
FAQ Developer Documentation
FAQ Installation
社区
社区首页
社区中心
帮助中心
不轉換
简体
繁體
簡體中文
disable
澳門繁體
大马简体
disable
正體中文
编辑“
Theme Development
”(章节)
返回页面
编辑
可视化编辑器
查看历史
讨论 (0)
正在编辑
Theme Development
注意:
你尚未登入本站,你的IP位置會被記錄在本頁的修訂歷史頁中。
反垃圾检查。
不要
加入这个!
====基本的模板==== At the very minimum, a WordPress Theme consists of two files: * <tt>style.css</tt> * <tt>index.php</tt> The <tt>index.php</tt> [[Templates|template file]] is unique and flexible. It can be used to include all references to the header, sidebar, footer, content, categories, archives, search, error, and other web pages generated by the user on your site. Or it can be ''subdivided'' into modular template files, each one taking on part of the workload. If you do not provide any other template files, WordPress will use the built-in default files. For example, if you do not have either a <tt>comments.php</tt> or <tt>comments-popup.php</tt> template file, then WordPress will automatically use the <tt>wp-comments.php</tt> and <tt>wp-comments-popup.php</tt> template files using [[Template Hierarchy]]. These default templates may not match your Theme very well, so you probably will want to provide your own. If you want to subdivide the <tt>index.php</tt> master template file, as showcased in the Default WordPress Theme, you can. Such subdivision or modularization is optional. These modular template files may include these basic files: * <tt>header.php</tt> * <tt>sidebar.php</tt> * <tt>footer.php</tt> * <tt>comments.php</tt> * <tt>comments-popup.php</tt> These are the basic files needed to make a Theme. Place them with <tt>style.css</tt>, and <tt>index.php</tt> into their own subdirectory beneath <tt>wp-content/themes/</tt>, and you have a Theme. Using these modular template files, you can put template tags within the <tt>index.php</tt> master file to include or ''get'' these units where you want them to appear in the final generated web page. * To include the header, use the <tt>[[Include Tags#The Header Template|get_header()]]</tt> template tag. * To include the sidebar, use the <tt>[[Include Tags#The Sidebar Template|get_sidebar()]]</tt> template tag. * To include the footer, use the <tt>[[Include Tags#The Footer Template|get_footer()]]</tt> template tag. Here is an example of the ''include'' usage: <pre><?php get_sidebar(); ?> <?php get_footer(); ?></pre> For more on how these various Templates work and how to generate different information within them, read the [[Templates]] documentation.
摘要:
请注意在Wordpress 中文上的所有贡献都将依据CC-BY-SA进行发布。
取消
编辑帮助
(在新窗口中打开)
Follow on IG
TikTok
Join Fan Lab