Simplify conditionals using arrays in PHP/JS Simplify conditionals by checking against an array instead of variables individually #javascript #php
Useful Body Classes for Wordpress WordPress is a super powerful CMS, and you can make it work even harder for you through the power of body classes. #wordpress
Interpolating variables and multiline markup in PHP Various methods on writing and returning variables within markup in PHP #php #html
Dynamic Scroll Based Classes Here is a super useful snippet for dynamically updating the body's class based on scroll position in the browser. #javascript #css
How to embed partials in Markdown Using Hugo It's not often easy to intersperse markup in markdown. Hugo makes this easy with the use of shortcodes. #hugo #markdown
Click to scroll to the next section Create dynamic buttons that scroll to the next section on the page #jquery
Offset a WordPress loop with pagination Understanding how pagination works in WP is hard. Offsetting loops with pagination can be harder. Luckily, I went through all this trial and error so you don't have to! Copy and paste (almost) guaranteed. #wordpress
Netlify x Hugo : using custom headers for better caching Netlify turns off caching by default. Learn how to cache assets using Hugo and Netlify's custom headers. #api #hugo
Get the *actual* page ID in WordPress archives Useful if you want to retrieve specific page ID's from an archive template #wordpress
List a post's terms without permalinks Easily get a post's terms and list them with separators. #wordpress
Check if a device is a touchscreen Sometimes it's useful to know if the device a user is visiting on is a touchscreen or not. This is because touchscreens don't generally render things like hover states. #javascript
Alter a query in WordPress with pre_get_posts You can alter multiple queries with ease using this single function. #wordpress
Centering elements with CSS You wouldn't think it, but centering elements with CSS has got to be one of the most finicky things ever. #css
Responsive images in WordPress with srcset srcset is handled extremely well by WordPress. I use this tag for almost all images I serve on a page (even backgrounds). #wordpress