Skip to content

Instantly share code, notes, and snippets.

Avatar
🌱
On mat leave!

Piper Haywood piperhaywood

🌱
On mat leave!
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am piperhaywood on github.
  • I am piperhaywood (https://keybase.io/piperhaywood) on keybase.
  • I have a public key ASAxZ7Cd-Xx0tXuNahh6lcqFyBwF4Vddy2dByU6vDKhLYwo

To claim this, I am signing this object:

@piperhaywood
piperhaywood / example_apprch-wp-srcset.php
Last active Aug 29, 2015
Example of apprch-wp-srcset
View example_apprch-wp-srcset.php
<?php
/**
* Example of using apprch_wp_srcset() within WordPress loop. For function code to paste in to functions.php file, see URL below.
* @link https://gist.github.com/piperhaywood/96ac07ea5f4999512275
*
* In example, browsers without
* 'srcset' image attribute support are served 'large' image in 'src'.WordPress function to
* create HTML5 image element with 'srcset' and 'sizes' attributes for JPEGs and PNGs.
*
@piperhaywood
piperhaywood / apprch-wp-srcset.php
Last active Mar 13, 2020
WordPress function to create HTML5 image element with 'srcset' and 'sizes' attributes for JPEGs and PNGs. Paste in to functions.php for use elsewhere in theme.
View apprch-wp-srcset.php
/**
* WordPress function to create HTML5 image element with 'srcset' and 'sizes' attributes for JPEGs and PNGs.
* Paste in to functions.php for use elsewhere in theme. Images in 'srcset' are created from all WordPress registered image sizes.
* Mime types 'image/jpg', 'image/png', and 'image/gif' are returned appropriately.
*
* @author Piper Haywood <piper@approach.co.uk>
* @link http://piperhaywood.com
* @link https://gist.github.com/piperhaywood/96ac07ea5f4999512275
*
* @example https://gist.github.com/piperhaywood/686cc0c788bd9fc3fa6e