Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Emil Wallgren
Emil Wallgren
11,737 Points

editing small text pieces in wordpress

Hi

I'm currently working on a clients website and is converting it to wordpress for the first time. In the header, there is some small piece of text (two scentences) that I would like to make customizable through the admin area.

How do you recommend me to do it?

4 Answers

Jacobus Hindson
Jacobus Hindson
14,429 Points

Hi Emil,

I would use a loop in my header that queried a Post name "Header Info" or something similar and direct your client to edit that post when they wanted it changed.

You could also create a custom post type that may make it clearer when the customer went to edit it.

If this is only required on certain pages the get_header() function can be passed a custom header such as get_header( 'custom'). Then create a custom header as header-custom.php. You can substitute custom with anything of your choosing.

Emil Wallgren
Emil Wallgren
11,737 Points

ah ok :-)

Thanks!

/Emil

Hi Emil,

If these are to show across the website on all pages you could use a custom widget area (setup via functions.php) and simply assign a text box to that widget area. The text boxes have the ability to include paragraph tags if required.

-Rich

Jacobus Hindson
Jacobus Hindson
14,429 Points

Great Idea Rich. A WYSIWYG editable widget area would be fantastic also. Thumbs Up!

Thanks :)