Viewing: WordPress

WordPress: Get the ID for the Front Page and Home

Normally in WordPress if you wanted to access an ID for a post or page you would reference the global $post variable. However, what if you wanted to access the ID for the Home and Front Page templates? In that case you will need to reference the stored ID from the WordPress database using the […] Read More

Remove Extra 10px from Captions

WordPress by default adds an extra 10px to the width of the container that wraps images with captions. This is because the default styling for captions has a thin border that surrounds the entire image. In a recent design I decided I wanted to caption images in a slightly different way and just have the […] Read More

Make Embedded YouTube & Vimeo Videos Responsive

Embedding videos in WordPress is really very simple. Just paste the Video URL into the visual editor and boom! Magic happens! But there is one minor issue. These videos are not responsive by default and will scale incorrectly like this. There are  a number of ways you could fix this, you could go into text […] Read More

Add Defer & Async Attributes to WordPress Scripts

WordPress developers often enqueue scripts incorrectly and sometimes it was done for a reason because WordPress didn't have a simple way to add the new'ish async and defer attributes, but that is no longer the case. Since Version 4.1 a new filter has been introduced that finally provides a less painful solution to add async or defer […] Read More