Adding and using custom user profile fields

My profile and Twitter link

Since I’ve been playing around with user management a lot lately, I thought I’d share a simple technique I picked up. This technique will allow you to easily add new user profile fields that your blog’s users can use to input more information about themselves.
Management of these fields will be coming in a later version of my user management plugin, but some of you may want to do this now.
In this tutorial, I’ll show you how to add an input box for a Twitter username and how to display it on your site, which will look a little something like this:
My profile and Twitter link
If you want to see a live example, check out one of my latests posts on Pop Critics.
Adding custom user fields
Open your theme’s functions.php file and drop this PHP code in:
add_action( ’show_user_profile’, ‘my_show_extra_profile_fields’ );
add_action( ‘edit_user_profile’, ‘my_show_extra_profile_fields’ );

function…

You Might Also Like...

  • WordPress-Christmas-16

    Extend the User Contact Info in WordPress 2.9

    47 readersJoost de Valk wrote about a month ago a really great article about his idea, to expand the user contact fields (thanks Joost!). In version 2.9 you are able to use this possibility. Here a little example, how you can use this functionality. First you write your own function in your functions.php of your theme.

  • WordPress edit area with own meta boxes

    Example How To Add Meta Boxes To Edit Area

    41 readersAdditional fields, meta boxes, in the edit area of WordPress often are useful and easier for customers instead of using Custom Fields. A small Plugin will show you three options. Use it, make WordPress even better for your clients. Learn how easy it is to adjust the edit area in WordPress. This Plugin adds 3

  • How to automatically create a custom field when a post is published

    2561 readersEver wanted to be able to automatically create a custom field with a value when a post (or page) is created? Then this snippet is for you.Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try it for free!How to automatically create a custom field when a post is

  • Rock-Solid WordPress 3.0 Themes using Custom Post Types

    2762 readersThe WordPress community is buzzing with excitement over the soon-to-be-released WordPress 3.0. Currently in Beta 2 now, WordPress 3.0 will have a lot of exciting new features , such as a new default theme and better menu management. Quite possibly the most exciting of these features is custom post types. In this tutorial, we’ll talk

  • Creating Custom Fields for Attachments in WordPress

    2619 readersCustom fields in WordPress make it easy to customize your theme in a variety of ways; plus, they are simple to implement for posts and pages. Attachments, on the other hand, take a bit more work to implement, requiring you to read through and decipher core source code in order to make them work. We’ll

  • WordPress-Christmas-15

    Display Private Posts to Logged in Users

    25 readersSometimes I use the function of private posting in WordPress. These contributions can only see the user who has created the post, or the administrator. To show all these article to users who are logged into the system, you can go different ways. But I'd like to highlight just two different ways. With custom fields

  • Excerpts and taxonomies for pages in WordPress 2.9

    737 readersHow to make use of a simple file change in WordPress 2.9 to add an excerpt box and custom taxonomy boxes to your page editor.

  • WordPress-Christmas-13

    Update RSS Language Value

    39 readersAnd today opens the 13th door of our Advent Calendar. You cannot only use a language key for your blog, but also for your feed:<language>en</language>. WordPress also has provided an option, but not easy to maintain. However, it is advisable to use the key according to the codec and therefore I show you some ways.

  • Custom Page Titles from Scratch

    1889 readersThe titles of pages are controlled by the <title> tag in the <head> section of a website. They are important for all kinds of reasons. Telling the user where they are. The name of the page when bookmarked both locally and socially. They are important for SEO. So how do we typically handle page

  • Custom Fields - Links and MyData

    How to Only Retrieve Posts With Custom Fields

    533 readersOne question I come across a lot regarding custom fields is how to only retrieve posts based on a custom field. For example, if a post has a custom field of “MyData”, someone might want to only retrieve that particular post. The WordPress Codex has a technique for retrieving posts based on custom fields, which consists of