Do more with your WordPress using the function reference

Daniel Pataki
Aug 26, 2009
Updated • Dec 29, 2014

If you've been developing themes, or taking a go at modifying your own, chances are you've run into the WordPress Template Tags page. This part of the WordPress Codex lists numerous functions you can use to customize your themes quickly and easily, even if you're just stepping into the wonderful world of modifying your blog, it's worth a look.

Among other things, it allows you to add category lists, show comment ID-s, show comment authors, display next image links, add a dropdown box of categories anywhere, useful, and basically "drag and drop".

There is however another great WordPress reference which is a bit more obscure, but also contains a huge load of functions for some other tasks you might have around your site. The WordPress Function Reference section of the codex lists at least 250-300 functions for pages, authors, plugin usage, comments, users, etc, in short, encompassing the whole blog platform, as opposed to more blog post oriented functions in the Template Tags section.

The page is chock full of things like "in_category()", which if passed a post ID and a category, will tell you if that post is in the category or not. Great if you want to display category specific content on your main page for example. It also gives you real power, with functions like "wp_insert_post()", which you can use to insert posts "manually", by passing an array of info to the function. Similarly you can use wp_insert_user() to add a user, with the parameters you want. Very useful for creating some custom sign up forms, custom permissions and so on.

What I've come to appreciate while using these functions is how very well WordPress is thought out. I sort of knew this 3 years ago when I started, but when I began to use these functions I realized why. For example, wp_insert_user() will insert a new user, and will return the new user's ID. It returns 0 if there is an error, but more importantly, if you pass an existing user's ID, it will update that user, instead of creating a new one. There is a separate wp_update_user() function, but the action they perform is so close, it's very handy that inserting a user is so flexible.

If you're just jumping into these functions you'll find them quite easy to use, while giving you a lot of control. If you're an experienced PHP programmer you'll find you'll program less, and you'll also appreciate the work going into WordPress a lot more!

Do more with your Wordpress using the function reference
Article Name
Do more with your Wordpress using the function reference
Provides information about the function reference in WordPress including how to use it.

Previous Post: «
Next Post: «


  1. Daniel Pataki said on August 30, 2009 at 8:22 pm

    Yes, I honestly don’t know why they don’t make this more apparent. I can see the distinction between template tags and functions, but still, I think they could “market” this a bit better.

  2. Alex said on August 26, 2009 at 10:31 am

    Very nice post. I never tought there were so many wp template tag choises

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.