Category Archives: Wordpress Development

Tutorials, articles, code, and examples for WordPress theme and plugin developers.

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 …