Masonry Galleries (including Flickr)
Masonry galleries are called by passing parameters/options through a custom field. Those parameters are separated by ‘|’. There are various types of masonry galleries that can be created via WordPress media and via third party products such as flickr and google photos.
View an example masonry gallery at the bottom of this post.
Masonry Galleries using Google Photos
Custom field name: Google Photos Attributes
Value: google photos album url|number of images|sort by
Examples:
- To call 200 images in a randomised order from a google album we’d add this value to the custom field:
https://photos.google.com/u/2/share/AF1QipNmG5RrJfwh7AgNKctPN6u3hWOO609JFuYseWwUKfIaJ0i1VGI4Wv1nnAuLB9oO6Q?key=V2FNbldsSDVPSkF4ZEJXcDluS0lqNTdYMGIzSUhn|200|shuffle
- Not all values have to be set. Where some parameters are not set, default options will be used instead. For example, the call below has no sort value, so ‘most recent’ will be used as the backup/default:
https://photos.google.com/u/2/share/AF1QipNmG5RrJfwh7AgNKctPN6u3hWOO609JFuYseWwUKfIaJ0i1VGI4Wv1nnAuLB9oO6Q?key=V2FNbldsSDVPSkF4ZEJXcDluS0lqNTdYMGIzSUhn|200
- Similarly, a hard limit is set if ‘number of images’ is left blank. So you can make a call by passing the google album url only:
https://photos.google.com/u/2/share/AF1QipNmG5RrJfwh7AgNKctPN6u3hWOO609JFuYseWwUKfIaJ0i1VGI4Wv1nnAuLB9oO6Q?key=V2FNbldsSDVPSkF4ZEJXcDluS0lqNTdYMGIzSUhn
Masonry Galleries using Site Images/Media
We tap into the MCM Categories plugin for this, calling images based on category slugs.
Custom field name: Masonry Attributes
Value: slug(s)|number of images|sort by
Examples:
- To call 30 images in a randomised order from the curriculum and facilities categories we’d add this value to the custom field:
curriculum,facilities|30|shuffle
- Not all values have to be set. Where some parameters are not set, default options will be used instead. For example, the call below has no sort value, so ‘most recent’ will be used as the backup/default:
facilities|50
- Similarly, a hard limit is set if ‘number of images’ is left blank. So you can make a call by passing category slug(s) only:
facilities
Masonry Galleries using Flickr Images
Custom field name: Flickr Set ID
Value: Flickr set ID(s)|number of images|sort by
Examples:
- To call 300 images in a randomised order from 2 flickr sets we’d add this value to the custom field:
72157710483679331,72157710324289822|300|shuffle
The ability to call multiple flickr galleries is built in. To do this just separate ID’s with a ‘,’ like the example above. - Not all values have to be set. Where some parameters are not set, default options will be used instead. For example, the call below has no sort value, so ‘most recent’ will be used as the backup/default.
72157710483679331|300
- Similarly, a hard limit is set if ‘number of images’ is left blank. So you can make a call by passing a flickr ID only.
72157710483679331














