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 WordPress Theme Development Finishing Your WordPress Theme Finishing Your WordPress Theme Quiz

According to the video, create_widget() is the function used to create a widget area for a theme. Why is it rejected?

I've rechecked the widgets video multiple times, rechecked my notes, and I cannot find any function other than create_widget() that does what the question describes. Yet my answer is consistently rejected. What's going on with this?

2 Answers

Austin Whipple
Austin Whipple
29,725 Points

Hi Ethan,

This question is asking you for the function used to create a new widget area, not necessarily a new individual widget.

To create a new widget, you use register_widget(), but in this can you want to use register_sidebar() to create a new widget area. The widgets don't necessarily need to be included in a sidebar.php file, they can be included in any template.

Be sure to give the Codex a good read as it has loads of information on widgets and other theme development tasks.

Thanks!

Anastasia Khazova
Anastasia Khazova
5,640 Points

This didn‘t work for me for the same question. What could be the problem?

The _____ () function is used to create widget areas for a theme.

Austin Whipple
Austin Whipple
29,725 Points

Anastasia,

"register_sidebar" still works for me as the answer here. I'd recommend double checking your response for typos and be sure not to include the parenthesis (they're already noted next to the empty field).