Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

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.

share|improve this answer
    
Great! That's what I was doing. Thanks for the link to the article series too. –  bernk Jun 13 '12 at 15:15
add comment

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

share|improve this answer
    
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. –  toscho Jun 14 '12 at 12:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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