Easy Editable Text Regions

diggingintowordpressChris Coyier published a great technique on the Digging Into WordPress site that explains how to create editable regions instead of text areas that are baked into the theme. For instance, ever get a theme with a block that looks like a widget but it’s really just a div container in the sidebar.php file that you manually have to edit? I know I have, a number of times, wishing it were just a text widget I could easily edit. Thankfully, the child theme I’m using for WPTavern.com is chock full of Widget areas so it’s a simple matter of creating a text widget and assigning it somewhere.

Another tidbit worth noting here is that in the example, the specific widget has a unique id number which you can assign a class too and thus, style in CSS. So in essence, you could give each text widget its own style. It would add more CSS to the themes CSS file but it might result in some cool outcomes.

2 responses to “Easy Editable Text Regions”

  1. I didn’t realize this was such a novel technique of coding individual multiple widget areas. I found it in the codex last month and immediately used it for the footer widgets in my Ground Floor theme. Although I agree, the post at Digging into WordPress does present another good use for this technique.

  2. Yes that’s a very good point how widgets all have unique ID’s. That hook alone allows you to do pretty much anything through CSS and JavaScript – each widget can look totally different!


Subscribe Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

%d bloggers like this: