Right now I have a p element in header.php containing the address and phone number my client wishes to use for contact info. How can I set this up so that it is editable through the WP admin area so that my client can easily change this in the future?


Store it in your theme options. Read the series of articles called The Complete Guide To The WordPress Settings API. Spare no effort to read it, especially 4th article about Theme Options.

  • Great! That's what I was doing. Thanks for the link to the article series too. – bernk Jun 13 '12 at 15:15

I have written a plugin exactly for this case: Public Contact Data. Last update just yesterday. :)

It can be extended easily by a filter 'pcd_fields', and the data are accessible by do_action() or custom shortcodes. It is translatable (of course), and a German translation is already included.

Before that I have put these things into themes too. But managing that was awkward, especially updates for multiple themes using this code.

Screenshot: Background shows the output in a theme, foreground the translated option fields.

enter image description here

  • Awesome! And it even supports German, great. I have no experience with plugin development yet, so this is a noob question but does it store the data in the wp_options table or what? – bernk Jun 14 '12 at 12:29
  • Yes, the data ist stored as a serialized array in the option 'public_contact_data'. In other words: It will survive a theme switch. – fuxia Jun 14 '12 at 12:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.