background preloader

Template Hierarchy

Template Hierarchy
Languages: English • Français • Italiano • 日本語 • 한국어 • Русский • Español • Português do Brasil • 中文(简体) • (Add your language) Introduction WordPress Templates fit together like the pieces of a puzzle to generate the web pages on your WordPress site. Some templates (the header and footer template files for example) are used on all the web pages, while others are used only under specific conditions. What this article is about This article seeks to answer the following question: Which template file(s) will WordPress use when it displays a certain type of page? Who might find this useful Since the introduction of Themes in WordPress 1.5, Templates have become more and more configurable. Using Conditional Tags WordPress provides more than one way to match templates to query types. The Template File Hierarchy The General Idea WordPress uses the Query String — information contained within each link on your website — to decide which template or set of templates will be used to display the page. Examples

Child Themes Languages: বাংলা • English • Italiano • 日本語 • 한국어 • Español • Nederlands • Français • Português do Brasil • Русский • Slovenčina • ไทย • 中文(简体) • 中文(繁體) • Македонски • (Add your language) A child theme is a theme that inherits the functionality and styling of another theme, called the parent theme. Child themes are the recommended way of modifying an existing theme. Why use a Child Theme? There are a few reasons why you would want to use a child theme: If you modify a theme directly and it is updated, then your modifications may be lost. How to Create a Child Theme Creating a Child Theme from an Unmodified Parent Theme A child theme consists of at least one directory (the child theme directory) and two files (style.css and functions.php), which you will need to create: The child theme directory style.css functions.php The first step in creating a child theme is to create the child theme directory, which will be placed in wp-content/themes. A couple things to note: <? Template Files <? if ( !

The Best Wordpress Plugins Advertisement WordPress is the most widely used and adaptable content management system out there, but you’re probably going to want some plugins to make it just right for your needs. Here, I’ve collated what I think are the best plugins – both from experience, and community recommendations. Remember though, the more plugins you install, the slower your site will be, so there’s a delicate balancing act between features and performance. Performance and Backup WordPress is great – but can be quite slow when faced with lots of traffic. Note: Many of these plugins should only be configured by advanced users – they could potentially break your site, so take care. W3 Total Cache The Swiss Army knife of caching and performance plugins, W3 handles everything from page caching to Content Delivery Networks and file minification. Better WordPress Minify Make no mistake, W3 Total Cache is a behemoth that can seem like it needs an engineering degree to set up correctly. WP SuperCache CloudFlare Duplicator

Page Templates Page Templates Pages are one of WordPress's built-in Post Types. You'll probably want most of your website Pages to look about the same. Selecting a Page Template Your Theme files should include a default page template (named: page.php). Edit Page Screen: You can assign a custom template for any individual Page by using the Template dropdown in the Edit Page screen (part of the Page Attributes module): Select a Template from the list (e.g., My Custom Page). All Pages Screen: The Quick-Edit and Bulk Edit options on the All Pages screen also have Template dropdowns. Template List Will Show Only If: There is at least one custom page template file in your active Theme's folder. Creating a Page Template WordPress offers several ways to display Pages. Conditional Tags Edit your default template: You can often make smaller Page-specific changes with Conditional Tags in your Theme's page.php file. Specialized Page Template page-{slug}.phppage-{ID}.php /wp-content/themes/my-theme/ Custom Page Template <?

Plugin API Plugin API Languages: বাংলা • English • Español • Français • 日本語 • 한국어 • Português do Brasil • ไทย • 中文(简体) • Русский • (Add your language) Introduction This page documents the API (Application Programming Interface) hooks available to WordPress plugin developers, and how to use them. This article assumes you have already read Writing a Plugin, which gives an overview (and many details) of how to develop a plugin. These hooks may also be used in themes, as described here. Hooks, Actions and Filters Hooks are provided by WordPress to allow your plugin to 'hook into' the rest of WordPress; that is, to call functions in your plugin at specific times, and thereby set your plugin in motion. You can sometimes accomplish the same goal with either an action or a filter. For a thorough listing of all action and filter hooks in WP see Adam Brown's WordPress Hooks Database. Function Reference Actions Modify database data. The basic steps to make this happen (described in more detail below) are: where:

Designing for WordPress: Complete Series & Downloads Over the last few weeks, I have been been doing a video screencast series on Designing for WordPress. It is a three-part series which covers downloading and installing WordPress on a server all the way to a completed theme. Part One: Download, Install, "Reset" Theme Video PageDirect Video Download (.mov) Part Two: Structure Video PageDirect Video Download (.mov) Part 3: Finishing Touches, Extra Stuff Video PageDirect Video Download (.mov) Download - "Personal Homepage Theme" I figured I might as well call it what it is! I literally designed this for use on my personal site, so you can see it live on chriscoyier.net. Download Theme Note: The orginal Photoshop file is included in the download in a folder called "orig" in the theme folder. In case you don't already know. Share On

How To Create A Multi Language WordPress Site How To Create A Multi Language WordPress Site October 20, 2012 at 11:00 am | Blog | 1 comment Recently, I had a chance to help a friend create a multi language wordpress site. And he suggested using a wordpress plugin named qTranslate. And actually i found it was very easy to use, so i want to share with you. Warning: this plugin will add tags to your wordpress contents. First, you can download the plugin from the wordpress plugin repository with a correct version. and save it into your /wp-content/plugins/ folder. or you can install it from the wordpress dashboard. In the settings page, you can also upload your own language if you found your desired language was not listed. You can add contents with other languages for posts,pages, and even custom post types. input the title for different languages, and switch between the language tabs to input the content accordingly. Also translate your category name to other languages English version and switch to Chinese version

Category Templates Category Templates When a viewer clicks on a link to one of the Categories on your site, he or she is taken to a page listing the Posts in that particular Category in chronological order, from newest Posts at the top to oldest at the bottom. There are many display choices, including whether to display the complete post or post excerpts, and what additional information to display (title, author, publish date, last modified time, etc.). Each theme makes different choices, and you might want to change them. This article explains how to change what happens when the blog viewer is visiting one of your site's Category pages. Permalinks to category archives are controlled Using Permalinks settings. What Template File is Used? The first step in modifying what happens when someone visits a Category page is to figure out which of your theme's files is going to be used to display the posts. In the case of categories, the hierarchy is fairly simple. Adding Text to Category Pages Static Text Above Posts

Hooks Database What is a hook? In brief, WordPress hooks enable you to change how WordPress behaves without editing any core files. Because you leave the WordPress files untouched, you can painlessly upgrade your blog with each new version of WordPress. It's this hooks architecture that makes WordPress the best blogging solution. If you don't know what WordPress hooks are for, read the Plugin API or this tutorial. What is this directory? If you're a plugin or theme developer, you know how difficult it can be to figure out which hooks are available. What is this good for? See what new hooks are available with each new version of WordPress See which hooks have been deprecated or renamed (use the "view all hooks" option) Easily learn exactly which WP file(s) use each hook. How to help? Update and improve the official action and filter references.

Web Hosting Tutorial: Learn How to Host a Website Do you want to know how to get your website live on the web with your own domain name and hosting? You've come to the right place! Buying a domain name, hosting package and getting your website live can be an incredibly intimidating and confusing process if you're unfamiliar with the territory, but let me tell you a secret: It's surprisingly easy! And I'm going to show you exactly how to do all of these things in no time by guiding you in a simple, step-by-step process. In less than 1-hour, you will no longer be uncomfortable with the process of purchasing a Domain Name & Hosting Package, or Uploading your Website Live to the Web via FTP. Don't have a Website or Blog yet? Want to Learn how to Hand-Code your own Website? So, what do you say?

Related: