Jake Paris

Snippets

SASS Mixins

Animations @mixin keyframes($name) { @-ms-keyframes #{$name} { @content } @-o-keyframes #{$name} { @content } @-moz-keyframes #{$name} { @content } @-webkit-keyframes #{$name} { @content } @keyframes #{$name} { @content } } @mixin animation($val) { msanimation…

GET Query Params with Javascript

var parseQueryParameters = function(){ var queryString = window.location.search; var queries = {}; if(queryString=='') return queries; var q = queryString.replace('?','').split('&'); q.forEach(function(pair,index){ var a = pair.split('='); if(typeof a[1]==='undefined') a.push(''); queries[a[0]] = a[1]; }); return queries;…

Shortcode to Use a WordPress widget in Page Content

A small snippet creating a shortcode which will display any widget.

Helper function (in vanilla js) to find a GET query parameter

var parseQueryParameters = function(){ var queryString = window.location.search; var queries = {}; if(queryString=='') return queries; var q = queryString.replace('?','').split('&'); q.forEach(function(pair){ var a = pair.split('='); if(typeof a[1]==='undefined') a.push(''); queries[a[0]] = a[1]; }); return queries;…

Using AJAX in WordPress

Most of the work of setting up an ajax action in the WordPress environment happens in php-land. The PHP File Register & enqueue your script. In this example, I’ll assume the script has already…