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

Alternative to repeating <div class="col-md-4"> three times for each widget in front-page.php

Instead of repeating <div class="col-md-4"> three times for each widget in front-page.php, was there a specific reason as to why @Zac didn't change the div class in the register_sidebar parameter in functions.php?

Original:

'before_widget' => '<div class="widget">'

Alternative:

'before_widget' => '<div class="col-md-4">'

I tried looking up the .widget class in the CSS but couldn't find any so I don't think the .widget class would have had any effect anyway.

Okay, I just realised why Zac did not set the 'before_widget' parameter to set the div class as "col-md-4" as the same register_sidebar function would be used later on to create other widgets such as the actual sidebar... I think it would have helped if he had explained more on why he chose certain values/parameters when registering functions or other similar situations.