Skip to content

Instantly share code, notes, and snippets.

@fitzryland
fitzryland / Returns image from Advanced Custom Fields Image Object
Last active December 19, 2015 02:19
Put this function in your functions file and pass the image object from ACF, classes you might want to put on the image, and the WordPress image size name. This function will return an image with the proper src, width, height, title. WordPress, Advanced Custom Fields Plugin
<?php
function custom_acf_image_output($aImg, $class, $size) {
if ($size) {
$widthString = $size . "-width";
$heightString = $size . "-height";
$imgStr = "<img src=\"" . $aImg['sizes'][$size] . "\" alt=\"" . $aImg['title'] . "\" width=\"" . $aImg['sizes'][$widthString] . "\" height=\"" . $aImg['sizes'][$heightString] . "\"";
if ($class) {
$imgStr .= " class=\"" . $class . "\"";
}
$imgStr .= ">";
@fitzryland
fitzryland / Self Clear Mixin'
Created June 28, 2013 08:22
This is the mixin' I use to make sure elements self clear. It isn't perfect, but is usually just the right thing.
@mixin group() {
&:after {
content: "";
display: table;
clear: both;
}
}
@fitzryland
fitzryland / mapFunctions.scss
Last active August 29, 2015 13:57
Essential Sass Map Functions
@function map($targetMap, $mapList) {
$mapItem: $targetMap;
@each $mapPart in $mapList {
$mapItem: map-get($mapItem, $mapPart);
}
@return $mapItem;
}
@function color($colorTree) {
@return map($color, $colorTree);
}
@fitzryland
fitzryland / basicSusyBreakpoints.scss
Last active August 29, 2015 13:57
My Basic Susy Breakpoint Setup
// $breakpoint-no-queries: false;
$breakpoint-no-query-fallbacks: true;
$susy: (
gutters: 0.2
);
$layouts: (
small: (
break: 0em 37.5em,