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 / SASS: Inner Column & Breakpoint Setup
Last active August 29, 2015 13:56
SASS: Inner Column & Breakpoint Setup
$mobileColumn: 400;
$narrowColumn: 700;
$multiColumn: 1000;
$mainWidth: $narrowColumn - 40;
$multiWidth: $multiColumn - 40;
$narrowWidth: 95%;
$mobileWidth: 90%;
@mixin breakpoint($point) {
@yellowberri-snippets
yellowberri-snippets / HTACCESS: 301 Redirect
Created February 26, 2014 19:40
HTACCESS: 301 Redirect
# Single Page
Redirect 301 /oldpage2.html http://www.yoursite.com/folder/
# Whole Site
Redirect 301 / http://newsite.com/
@yellowberri-snippets
yellowberri-snippets / HTML: Shortcut to _images Folder
Last active August 29, 2015 13:57
HTML: _images Folder Path
/wp-content/themes/yb/library/_images/
@yellowberri-snippets
yellowberri-snippets / COMPASS: Multiple Inline BG images
Created March 20, 2014 19:30
COMPASS: Multiple Inline BG images
background:
inline-image("../_images/quote-top.png", 'image/png') no-repeat top left,
inline-image("../_images/quote-bottom.png", 'image/png') no-repeat bottom right
;
@yellowberri-snippets
yellowberri-snippets / PHP: ACF: Repeater Field to Image Gallery or Flex Slider
Last active August 29, 2015 13:57
PHP: ACF: Repeater Field to Image Gallery or Flex Slider
@yellowberri-snippets
yellowberri-snippets / SASS: Horizontal Image Gallery Mixin
Last active August 29, 2015 13:57
SASS: Horizontal Image Gallery Mixin
@yellowberri-snippets
yellowberri-snippets / PHP: Ternary If-Else Shortcut
Created March 28, 2014 19:48
PHP: Ternary If-Else Shortcut
<?php echo ( $boolean === true ? 'if' : 'else' ) ?>
@yellowberri-snippets
yellowberri-snippets / PHP: WP: The Default Loop
Last active August 29, 2015 13:58
PHP: WP: The Default Loop
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php endwhile; ?>
<?php endif; wp_reset_postdata(); ?>
@yellowberri-snippets
yellowberri-snippets / PHP: WP: Override Posts Per Page for "Built-In" Loops
Created April 4, 2014 21:29
PHP: WP: Override Posts Per Page for "Built-In" Loops
// Modify the 'posts_per_page' arg for pages with "built-in" loops (categories, search, etc)
function page_post_counts( $query ) {
if ( $query->is_search() === true ) {
$query->query_vars['posts_per_page'] = 10;
}
}
add_action( 'pre_get_posts', 'page_post_counts' );