Categories
Development

Adding Bulma support to WordPress

I’m starting to get back into some late-night WordPress development. I also have a newfound love for Bulma, which is the closest thing I’ve seen to nailing an implementation “CSS building blocks”. It makes it really easy to build the layout of the site with minimal additional markup, and gets out of the way as soon as you want to start customizing.

The same can not be said about WordPress. Out of the box, WordPress theme development sort of sucks. There’s a ton of magic, and you have to override everything in super random places. But here’s how you can make them play nice.

First, you need to add a custom nav walker to your site. Add a file in inc or wherever you keep miscellaneous bits of PHP code with the following Gist.

https://gist.github.com/clausmith/10c8c9d3635edd891c0597e786e6af8b

Then, in functions.php, add this at the bottom:

/**
 * Custom nav walker with bulma support.
 */
require get_template_directory() . '/inc/nav-walker.php';

Lastly, replace the call to wp_nav_menu in your header.php or wherever you want your navbar to be with this:

wp_nav_menu(
	array(
		'theme_location' => 'menu-1',
		'menu_id'        => 'primary-menu',
		'menu_class'     => '',     // ignored
		'container'      => '',     // ignored
		'menu_class'     => '',     // ignored
		'items_wrap'     => '%3$s', // NOT ignored
		'walker'         => new Bulma_Nav_Menu()
	)
);

That should give you a nice, clean, Bulma-friendly navbar. Now back to hacking out all of this WordPress markup. While code might be poetry, WordPress is not.

Categories
Development

Movie Set Urbanism

https://www.strongtowns.org/journal/2020/2/6/movie-set-urbanism

I recently read this article talking about the rise of pseudo-main streets, or what the author calls “movie set urbanism”. These are typically suburban complexes that have been very intentionally designed to look like old-fashioned, authentic main streets like you might see in a movie or a small town. But once you step beyond the storefronts, you realize you’re actually just in the middle of a big parking lot – kind of like a movie set. It is quite literally a façade.

As outlined in the article, the problem is that these are not actually main streets. Most of the development is dedicated to parking, because these developments are constructed in areas where very few residents are within walking distance the way an actual main street would. What that means is most of the customers of these main streets have to get in their car and drive here anyway. Therefore, these malls share none of the convenience with an actual main street and are not sustainable.

In principle, I completely agree with everything in the article. But there’s one caveat: winter.

The original author has a Masters in Urban and Regional Planning from the University of Minnesota, so he should be able to empathize. It’s currently -23º C outside here in Ottawa, and in all likelihood it’s going to be below freezing for another couple of months.

Here’s my open question for anybody reading: in your opinion, what does sustainable development look like in a world where walking even moderate distances is impractical for a significant portion of the year?