O'Reilly logo

WordPress 2.8 Themes Cookbook by Lee Jordan, Nick Ohrn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding a custom user field to display an author's Twitter link

We can use the data that describes the author, their "metadata", to display a variety of information, in most cases, the same as that retrieved by using $authordata or user_data, as seen in previous examples in this chapter. However, sometimes a plugin gathers additional custom metadata such as an IM username or a Twitter name. In that situation, applying a special template tag called the_author_metadata to an author page is very useful.

In this example, we will create a custom user field for the user profile page in the WordPress control panel, and then use the Twitter metadata that it provides to display the author's Twitter username on the author page.

Getting started

You will need ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required