Skip to content

Instantly share code, notes, and snippets.

View yellowberri-snippets's full-sized avatar

Dalton Yellowberri yellowberri-snippets

View GitHub Profile
@yellowberri-snippets
yellowberri-snippets / JS: Animated Scroll
Last active December 30, 2015 01:59
JS: Animated Scroll
function animateTo(location, speed) {
$('html, body').animate({
scrollTop: location
}, speed);
}
@yellowberri-snippets
yellowberri-snippets / JS: Place After in Source Order
Last active December 30, 2015 04:49
JS: Place After in Source Order
function placeAfter(element, destination) {
var element = $(element);
element.remove().clone().insertAfter( destination);
}
@yellowberri-snippets
yellowberri-snippets / PHP: WP: The Ultimate WP_Query
Created December 11, 2013 16:13
PHP: WP: The Ultimate WP_Query
// http://www.inteligraphics.ro/2013/06/20/wordpress-wp_query-args-parameters-list/
$args = array(
//////Author Parameters - Show posts associated with certain author.
'author' => '1,2,3,' //(int) - use author id [use minus (-) to exclude authors by ID ex. 'author' => '-1,-2,-3,']
'author_name' => 'luetkemj', //(string) - use 'user_nicename' (NOT name)
//////Category Parameters - Show posts associated with certain categories.
'cat' => 5,//(int) - use category id.
@yellowberri-snippets
yellowberri-snippets / JS: JQUERY: Add .exists() method
Created December 12, 2013 16:47
JS: JQUERY: Add .exists() method
$.fn.exists = function () {
return this.length !== 0;
};
@yellowberri-snippets
yellowberri-snippets / PHP: WP: Embed Gravity Form
Last active December 31, 2015 16:19
PHP: WP: Embed Gravity Form
gravity_form(
$id_or_title,
$display_title=true,
$display_description=true,
$display_inactive=false,
$field_values=null,
$ajax=false,
$tabindex
);
@yellowberri-snippets
yellowberri-snippets / CSS: Full Width Gravity Form
Last active September 25, 2020 19:21
CSS: Full Width Gravity Forms
.gform_wrapper {
form .gform_body .ginput_complex input[type=text] {
width:100% !important;
}
input, input[type=text], select, textarea {
width:100% !important;
@include box-sizing(border-box);
}
}
@yellowberri-snippets
yellowberri-snippets / JS: JQUERY: breakSetup - Run Code Based on Break Points
Last active December 31, 2015 21:29
JS: JQUERY: breakSetup - Run Code Based on Break Points
var $state;
function breakSetup( $breakwidth, $operator, $callback ) {
var w = $(window),
$width = w.width();
var operators = {
'<' : function( a, b ) { return a < b ; },
'>' : function( a, b ) { return a > b ; },
'<=' : function( a, b ) { return a <= b ; },
@yellowberri-snippets
yellowberri-snippets / CSS: Zoom and Show Image Background
Created January 2, 2014 21:40
CSS: Zoom and Show Image Background
.wrapper {
background-image: url('image.jpg');
background-repeat: no-repeat;
background-position:center center;
overflow:hidden;
img {
display:block;
opacity:1;
@include transform(scale(1,1));
function is_empty(&$val) {
return empty($val) && $val !== "0";
}
@yellowberri-snippets
yellowberri-snippets / CSS: WP: White Label Login Page
Last active January 2, 2016 20:29
CSS: WP: White Label Login Page
body.login {
background-color:#efe2d8;
}
body.login div#login p#nav a,
body.login div#login p#backtoblog a {
color:#0c2e53 !important;
text-shadow:none;
}