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
27,491 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
27,491 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).