WordPress
-
Attachment Image Snippet
This snippet for wp_get_attachment_image_src frequently appears in my theme development to select an image by its unique ID in the WordPress media library. Handy for instances where logos, banners, or any other image frequently recurs on a website and you’d rather store that image in the media library where it can be replaced or modified…
-
Adding alt text to a post thumbnail
While working on a custom navigation using WP_Query and has_post_thumbnail for an icon I ran into an accessibility concern. By default, the_post_thumbnail will not display an alt tag when rendered in the browser. In the following code snippet I add an alt tag using the image file’s title. In short the code above starts with…
-
Dipping into Child Themes
Theme development looks complicated but it doesn’t have to be. WordPress Child Themes give you the power to progressively enhance a theme and adapt it to suit your needs.