"Ecommerce with WordPress and WooCommerce" was retired on December 31, 2017.

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 WooCommerce Theme Development Global and Product Templates and Hooks The Main Shop Template

Brandon Frisch
Brandon Frisch
134 Points

Why do we have to insert the loop_shop_columns filter in functions.php?

Why can't I simply change the "4" to a "2" straight from the content-production.php file?

1 Answer

You could. But Zak is showing you how you can do it programmatically. E.g., different # of columns for laptops vs mobile devices. You're not going to be changing a 2 to a 4 every time someone switches from their phone to the MacBook Pro.

Brandon Frisch
Brandon Frisch
134 Points

Thanks for the quick reply. Still a bit confusing to me, but you cleared up the main reasoning behind my question: that I can in fact do that but this is how I do it programmatically.

Thanks