Currently Browsing: WPDev101


Get Image ALT Attribute Using Attachment ID

Code that allows you to easily get the alt attribute value for images in WordPress based on the attachment ID. With some fallbacks in case the alt attribute for the image is not supplied.


Enable Gutenberg on Custom Post Types

Gutenberg is the new content editor in WordPress. But it’s not automatically applied to custom post types, they still use the classic editor. It might be automatically applied in the future but for now a slight code adjustment is needed.


Adding Custom Classes to the Body Tag in WordPress

How to add custom classes or remove existing classes from the body tag in WordPress.