Wordpress Theme Development Quick Start

2019-07-31 08:33发布

I tried looking for a quick and dirty getting started with wordpress theme development tutorial. Now I know how to go and discover things myself, I'm looking for "top ten FAQ for programmers" when starting wordpress development. (For example, Turn on debugging and where the debugging option is located), how best to setup your dev environment.

All I can find is elaborate or too low level or too high level guides to it. Coming from a background of creating custom wordpress-like applications makes me frustrated.

So perhaps someone can list of the few things I need. I don't need to know how wordpress works, what a database or widget or page is.

Question I was specifically searching for: 1. How do I make wordpress watch the theme folder for changes from my IDE ( I can't really believe anybody would develop through the wordpress admin theme editor...No Undo history!). Changing the files doesn't seem to take affect until I re-install the theme. Debug mode needs to be true?

  1. Any links condensed version of this: http://codex.wordpress.org/Theme_Development or similar?

3条回答
ら.Afraid
2楼-- · 2019-07-31 08:58

you need to become familiar with basic wordpress functions like the_permalink, the_title, the_content, etc. these are easy to remember and you can always refer to wordpress.org documentation if you don't want any out of box functionality and you pay more attention to design

if you intend to submit theme to wordpress.org than turn on debugging wile developing and read this before start http://codex.wordpress.org/Theme_Review

查看更多
疯言疯语
3楼-- · 2019-07-31 09:00

WordPress use a hierarchy of files to determine what ends up being shown to the user. For starters all you need to create a WordPress theme is a style.css and index.php.

This is what you will have to put in your style.css in order to make it a valid WordPress theme:

/*
Theme Name: Your theme name
Theme URI: http://www.example.com/
Description: Describe your theme.
Author: Your name or company
Author URI: http://www.example.com/
Version: 1.0
Tags: black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style, custom-menu (optional)

License:
License URI:

General comments (optional).
*/

All you really need to include is a unique name for your theme and WordPress will recognize it and list it among your other themes. Even though that works, I would recommend including as much info as possible.

With just two files, index.php will then run for every single page view, no matter the type of content the user asks for. You can extend this by adding files like page.php to display all your pages, single.php to display single posts differently and so on.

I highly recommend getting familiar with the WordPress Codex. This is a good place to start: http://codex.wordpress.org/Template_Hierarchy

The image below explains the hierarchy and what file ends up being served. I use it sometimes for reference, there is no need to memorize it entirely.

enter image description here

查看更多
够拽才男人
4楼-- · 2019-07-31 09:00

Theme development for beginners can be made easier by basing it on an existing theme such as the twentytwelve theme. I have written a blog post on it here http://johnadavies.me/2013/09/19/wordpress-child-theme-development/ John

查看更多
登录 后发表回答