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 trialJaco Burger
20,807 PointsOne Page site widget areas
Hi Guys
I'm building a one page WP site, as explained in the workshop by Zac. I understand the loop structure, but I need a way to add widget areas only to certain "sections".
Any idea how I can go about it?
Thanks!
3 Answers
Muhammad Mohsen
Courses Plus Student 10,843 PointsHi Jaco,
Just to be clear, you want to display your custom registered widgets in certain areas within your page, but you don't have any sidebars registered, Is that right?
If so, the_widget(); (http://codex.wordpress.org/Function_Reference/the_widget) is what you looking for.
Dan Barrett
10,450 PointsI hope I am no hijacking this post but I am facing a very similar problem but really struggling to get a second pair of eyes on the problem. Mine is to do with the sidebar - I have created the functions within funtcions.php and they show in the admin area as available widget areas but the if statements are failing but they are exactly to how Zac has shown in the video.
Zac Gordon
Treehouse Guest TeacherYou should open a new forum post for this and include all the relevant code examples.
Zac Gordon
Treehouse Guest TeacherYou will likely have to use multiple loops in this case and insert the widget code between the loop.
Jaco Burger
20,807 PointsThanks Zac! Mind giving an example of such a loop? :)