To kick off 2019 strong in our Advanced WordPress Facebook group, we’ve started an intiative called the “AWP Challenge”. Essentially, we’re challenging our members to share something awesome that they’ve built or learned that week with a hashtag: #2019AWPChallenge
There’s only a couple rules behind it:
- These posts cannot be done in the form of a question or request for support at all
- These posts can be links to articles, but they have to provide context as to what they learned in writing/reading the article or essentially “give the inside scoop” behind the scenes of the article.
- Any code shared has to be shared via Gist or CodePen (code in FB is just ugly!)
This past week, we received 6 such posts. That’s a slow start for a big group. I’m hoping that publishing these round-ups regularly will give a little more incentive for posting in the group. Plus, we also want this website to start to provide a lot more value to the greater WP Community — those who aren’t on Facebook or chose not to be in AWP (for some crazy reason! 😉 )
So with no further ado, here’s some great things our AWP members have been working on lately.
NOTE: AWP members can click on the image links to see the original posts which have much more detail and great conversations. Another reason to join if you haven’t already
Simple CSS Grid Tweaks
Never one to shirk from putting my code where my mouth is, I decided to kick off the challenge with some simple CSS Grid tweaks I’ve been working on for our WP Business Reviews plugin. For those already familiar with CSS Grid this is nothing “advanced”. But for those looking to “advance” their skills in more modern CSS methods, this is a decent starter to see the power of CSS Grid for complex layouts.
Restricted Child Blocks for your CPTs
John Reeve shared a great Gist of how he’s implementing a Custom Post Type with Gutenberg, that has restricted blocks and specific Child Blocks. This is definitely the way many developers will be leveraging Gutenberg in the future for client projects that depend on CPTs.
He shared some background on his approach by saying these were informative and helpful articles for him:
What’s your take on what we name these things? Child-blocks? Inner Blocks? Nested Blocks? Minifigs?
Preloading versus Prefetching
Kevin Hoffman has been digging into the WPRig.io project and is excited about several aspects of it. One is how it is handling preloading. He says:
WP Rig is doing some exciting things to modernize CSS in WordPress themes. One such technique is called link preloading, which allows your page to start downloading assets sooner than they would otherwise be discovered. Think of stylesheets, images, or fonts that would otherwise not start downloading until the browser encounters them.
Hoffman explains how WPRig’s leverages progressive CSS techniques to load stylesheets in the body, and how preloading makes that even more efficient.
He also provided these reference articles and tutorials:
- Mozilla on Prefetching
- Mozilla on Preloading
- Smashing Magazine on Preloading
- WPRig’s readme describing how it leverages Progressive loading
We all have our preferences when it comes to our local development stack. Rob Bardall says he’s tried them all and ended up creating this custom stack he calls WPDryDock for several important reasons:
The main benefits to me are:
– It spins up fast
– It’s isolated from other projects
– It contains a bare-minimum theme
– It splits functionality out of the theme
– It has options to toggle Debug mode from the .env file
– It uses Laravel Mix to build CSS & JS
– It’s operating system agnostic
– It has only Docker as a local dependency
– Includes WP-CLI, PHPUnit, PHPCS, ESLint and XDebug
– Uses Composer to manage dependencies
Of all the recent AWP Challenge posts, Rob’s got the most reactions from members. Check out WPDryDock here, it’s worth kicking the tires. If you’re an AWP member, comment on the post with your questions for Rob, or feel free to contribute to the project on Github.
Alphabetizing Posts by Taxonomy Name
Josh McCall works with large publishers. In many cases storing each author as a WP User is impractical. So he stores them as taxonomies instead. That brings up other challenges though, he says:
The major pain point for those methods has been generating an author archive where the authors are sorted alphabetically by last name. After going through a few hacky solutions, someone (probably in the group) helped me figure out the perfect method. You enter the author names (term or post title) as LastName; FirstName and then re-sort the name on the front end. I use a semicolon here only because WordPress will screw with commas in some contexts but generally doesn’t care about semicolons.
His code (on Pastebin) is instructive. It’s encouraging to see AWP members helping each other find these nuanced solutions and then circling back and contributing value to the group like Josh did here. Thanks Josh!
A Model View Controler (MVC) Framework for WordPress
Carl Alexander isn’t the only dev writing great stuff for MVC in WordPress. Lucas Bustamente shared his “Modern WordPress Website” project and it’s quite impressive. He says,
Modern WordPress Website (MWW) is something that I’ve wrote to help people craft modern, testable WordPress websites and applications using MVC pattern in WordPress.
Members raised some challenging questions on this post, discussing the pros and cons and overall benefits. Iron sharpens iron as they say.
Checkout the projects Github repo. Lucas also provided this great video overview:
Consider Yourself Challenged!
That wraps up our first installed of the AWP Challenge Roundup. Subscribe to our blog to get notifications of more of these roundups in the future. If you’re already an AWP member, start working on your AWPChallenge for this week for us to include in the round up next week. If you’re not a member, why not!? Join today.
Matt is Partner and Head of Support and Outreach at GiveWP.com and Impress.org. He is the author of several popular free plugins, the Lead Organizer of the Advanced WordPress Facebook group (which boasts over 30K members), and blogs occasionally at his personal site mattcromwell.com about WordPress, Family life, and Religion and Politics.