This is the most detailed tutorial in the world (to my knowledge) on the topic of creating a WordPress theme from scratch. If you read it all, you will know everything you need to create a complete and powerful WordPress theme. The verbosity of this tutorial means it can be tailored to people of any skill level, from ace theme jockey to complete and utter beginner.
I even go so far as to break down the basics of HTML and CSS, so I do mean beginner. However, I realize not everyone needs this much detail, so I have also included links to skip past beginner sections for those are so inclined.
I’ve seen a lot of themes enqueuing style sheets and scripts incorrectly, either by calling them using the
wp_head hooks, or just placing
wp_enqueue_style() right in the header. The queue system works best when everything is queued at once, not periodically throughout the document. And calling with the
wp_print_styles hook in version 3.3 can end up putting your styles on the admin page. So, do it correctly using the proper hook: Read More …
WordPress 3.4 introduced a new method of dealing with custom headers and backgrounds. The old functions
add_custom_image_header( $args ) and
add_custom_background( $args ) were depreciated in favor of
add_theme_support( 'custom-header', $args ) and
add_theme_support( 'custom-background', $args ). While these new functions are pretty similar to their predecessors, there is still a good bit of information about working with them that is not on the codex (or anywhere else I looked). So here are some helpful tips when working with custom headers and backgrounds.Read More …
If you’ve submitted a theme to the Review Unit recently, you may have gotten this feedback:
Themes are REQUIRED to use ‘wp_title’ filter, to filter wp_title() (RECOMMENDED), or pass argument to wp_title() (OPTIONALLY), in order to modify document title content.
At first I was like “um wat…” but then I realized it’s a much cleaner way to echo the title tag since it allows plugins or other code to get an equal bite at fully changing the page title (no hardcoded title parts in themes).
However, unlike most other WordPress theme topics, there is a real dearth of practical examples or even explanations on the internet about how to actually do this for some odd reason. The codex page is quite unhelpful and I Googled 10 pages deep and only found 1 passing mention. So I had to figure this out on my own the old-fashioned, pre-internet way: trial and error.Read More …