Exploring Different Uses for Custom Fields

In this chapter, we use the example of adding your current mood to your blog posts by using Custom Fields. But you can use Custom Fields to define all sorts of different data on your posts and pages; you're limited only by your imagination when it comes to what kind of data you want to include.

Obviously, we can't cover every possible use for Custom Fields, but we can give you some ideas that you may want to try out on your own site — at the very least, you can implement some of these ideas just to get yourself into the flow of using Custom Fields, and hopefully they can spark your imagination on what types of data you want to include on your site:

  • Music: Display the music you're currently listening to. Use the same method we describe in this chapter for your current mood, except create a Custom Field named Music: Use the same code template, just define the key as: $key=“music”; and alter the wording from My Current Mood is: to I am Currently Listening to:.
  • Books: Same as the mood or music Custom Field, you can display what you're currently reading by creating a Custom Field named Book and define the key in the code as $key=“book”;, and then alter the wording from My Current Mood is: to I Am Currently Reading:.
  • Weather: Let your readers know what the weather is like in your little corner of the world by adding your current weather conditions to your published blog posts. By using the same method that we describe in this chapter, create ...

Get WordPress® All-in-One For Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.