摘要:
本文来自于WordPress的官方网站文档。但是中文版的没有翻译完成。这里翻译校对一下。 原文地址:http://codex.wordpress.org/Template_Hierarchy 简介 WordPress模板将主题内的文件像拼图一样拼在一起,生成你网站的页面。有些模板(比如页眉和页脚)是所有页面公用的;但是其它的模板则只在特定的情况下使用。 关于 这篇文章回答了下面这些问题: Wo... 阅读全文
摘要:
Index.php is the most crucial WordPress Theme Template. Not only because WordPress needs to use it if you’re missing any of its brother and sister templates (like, archive.php or tag.php) but because ... 阅读全文
摘要:
What archive.php does (and all its related templates) is show posts based on a select criteria. A date range, or posts by a certain author, a category, or a tag. So, basically, it’s a lot like index.p... 阅读全文
摘要:
The Search Template and The Page Template are vital to any complete WordPress Theme. And they’re both really easy to code.For both of these Templates, we’ll start with our template-template,single.php... 阅读全文
摘要:
I hate the Comments Template. There, I said it. It can be a confusing mess. Luckily for you, I’ve sorted it out. Confusing still, yes. But sorted out. For this tutorial on the Comments Template, I’m b... 阅读全文
摘要:
We’re just about ready to start building our theme’s template files. Before we do this, however, it’s time for a quick briefing on data validation and sanitation, an important procedure we’ll take to ... 阅读全文
摘要:
Now we’re starting to get into the real meat of WordPress Theme development: coding the HTML structure. The Goals of Any HTML Structure When coding a web site, you should have 2 goals in mind: lean co... 阅读全文
摘要:
You’ve built an index of all your posts, now you need to create a template to frame each piece of content (or missing content) on its own. In this lesson, you’ll create templates for single posts, post attachments, and 404 error pages.The Template for TemplatesThe structure of single.php (and almost 阅读全文
摘要:
THE WORDPRESS THEME HEADER TEMPLATENow we get into the nitty-gritty:building up yourheader.phpand validating your theme with an HTML Doctype. There’ll be a lot of PHP in this lesson, but don’t despair. We’re also going to do two essential (and kinda neat) search engine optimization techniques and ad 阅读全文
摘要:
We’ve got a file structure in place, now let’s start adding things to them!First, we’re going to add some PHP functions to our theme. These functions will serve a variety of purposes, including:adding support for WordPress features such as custom backgrounds, headers, post formats, etcsetting up the 阅读全文