Justin Tadlock has an excellent tutorial for Underscore.js templating beginners. I’m guessing that’s a lot of us.
The Underscore.js library has been in WordPress for many versions now. However, itâs next to impossible to find good tutorials that walk you through the process of utilizing it, step-by-step.
I got my first taste of it when building templates for the WordPress customizer, but thatâs just outputting data in a template. Thatâs the easy part and not much different from HTML + PHP. I had no idea how to send the data to the template. It was tough to find information on how to get from Point A to Point B.
I donât have a strong JavaScript background, so I felt completely lost trying to grok some of these concepts. But, getting the basics down isnât all that hard once you have that âlight-bulb momentâ or have someone explain it to you like an actual beginner.
It took me about two days to start getting comfortable working with Underscore.
In this tutorial, I want to share some basics to getting things set up and running if you want to build custom Underscore templates. If nothing else, maybe itâll help someone thatâs stuck in the early learning stages of utilizing Underscore templates.
Get on over there and do some learning. I did. Super helpful little guide. He implemented Underscore templates on the admin side of his recent Members plugin update.