Skip to content

Instantly share code, notes, and snippets.

View laurenclark's full-sized avatar
💜

Lauren Clark laurenclark

💜
View GitHub Profile
# REWRITES
# Canonical
RewriteEngine on
RewriteCond %{HTTP_HOST} ^site\.co.uk$ [NC]
RewriteRule ^(.*)$ http://www.site.co.uk/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^.*/index.html
RewriteRule ^(.*)index.php$ http://www.site.co.uk/$1 [R=301,L]
#prettyurls
RewriteCond %{REQUEST_FILENAME} !-f
$facebook_color : hsla(222, 47%, 40%, 1); // #365397
$twitter_color : hsla(198, 100%, 47%, 1); // #00a9f1
$linkedin_color : hsla(203, 100%, 35%, 1); // #006db3
$apple_color : hsla(0, 0%, 45%, 1); // #737373
$google_color : hsla(217, 89%, 61%, 1); // #4285f4
$google_plus_color : hsla(8, 74%, 53%, 1); // #e0452c
$youtube_color : hsla(0, 100%, 60%, 1); // #ff3333
$vimeo_color : hsla(200, 82%, 61%, 1); // #48b6ed
$pinterest_color : hsla(0, 78%, 45%, 1); // #ce1a19
$yelp_color : hsla(5, 100%, 38%, 1); // #c30f00
@laurenclark
laurenclark / gist:2469203d016787df78d7
Last active August 29, 2015 14:05
Custom Fields - Alternating Layout Boxes
//Requires Advanced Custom Fields PLugin and Custom Post Types UI
//Use <?php the_field('field_name') ?> to insert the fields into block.
<?php
$args = array(
'post_type' => 'your_custom_post_type',
'orderby' => 'date',
'order' => 'ASC',
);
@laurenclark
laurenclark / gist:9d4232cd5f36ad7c0bf1
Created August 20, 2014 15:36
Custom Fields WP_Query Loops
$args = array(
'post_type' => 'post_type',
'orderby' => 'date',
'order' => 'ASC',
'posts_per_page' => 3
);
$reference = new WP_Query( $args );
@laurenclark
laurenclark / SassMeister-input.scss
Created October 21, 2014 12:20
Generated by SassMeister.com.
// ----
// Sass (v3.4.6)
// Compass (v1.0.1)
// ----
@function grid-width($count, $gutter, $width){
$grid-width: ($count - 1) * $gutter + ($count * $width);
@return $grid-width;
}
@laurenclark
laurenclark / excerpt.php
Created December 1, 2014 14:42
Custom Field Wysiwyg Excerpt
//Get the excerpt for main_content
function custom_field_excerpt() {
global $post; //Contains data from current post in the loop.
$text = get_field('main_content'); //Cache the custom field to variable.
if ( '' != $text ) { //Check if it's empty.
$text = strip_shortcodes( $text ); //Remove any shortcodes as this is just an excerpt
$text = apply_filters('the_content', $text); //Apply the_content to $text
$text = str_replace(']]>', ']]>', $text);
$excerpt_length = 20; // 20 words
@laurenclark
laurenclark / settings.scss
Created December 16, 2014 11:17
Foundation Top Bar Change to Mobile Menu
$topbar-breakpoint: (900px) !default; // Change to 9999px for always mobile layout
$topbar-media-query: "only screen and (min-width: #{$topbar-breakpoint})";
@laurenclark
laurenclark / center.scss
Last active August 29, 2015 14:13
Centering Things!
.overlay{
position: relative;
img#float-logo{
display: block;
margin: 0;
position: absolute;
top: 50%;
left: 50%;
margin-right: -50%;
transform: translate(-50%, -50%)
@laurenclark
laurenclark / gist:847004311541e4bcd922
Created January 21, 2015 11:33
Foundation Menu Fix
.top-bar .toggle-topbar.menu-icon a:after {
box-shadow: 0 10px 0 1px $oil, 0 16px 0 1px $oil, 0 22px 0 1px $oil;
content: "";
display: block;
height: 0;
position: absolute;
right: 0;
top: 0;
width: 16px;
}
//Custom
function font_url() {
$font_url = '';
if ( 'off' !== _x( 'on', 'Lato font: on or off', 'foundationpress' ) ) {
$font_url = add_query_arg( 'family', urlencode( 'Lato' ), "//fonts.googleapis.com/css" );
}
return $font_url;