This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// generated on 2016-06-02 using generator-gulp-webapp 1.1.1 | |
import gulp from 'gulp'; | |
import gulpLoadPlugins from 'gulp-load-plugins'; | |
import browserSync from 'browser-sync'; | |
import del from 'del'; | |
import {stream as wiredep} from 'wiredep'; | |
const $ = gulpLoadPlugins(); | |
const reload = browserSync.reload; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Nominate the containing selector | |
var parentSelector = $('.quantity'); | |
// If it's on the page | |
if( parentSelector.length ) { | |
// Get the original HTML | |
var numberInputs = parentSelector.html(); | |
// Change number to text | |
var textInputs = numberInputs.replace('type="number"', 'type="text"'); | |
// Plus button |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.selector { | |
width: 100%; | |
height: 300px; | |
margin: 40px; | |
background: black; | |
/* The defaults */ | |
opacity: 0; | |
margin-top: 90px; | |
transition: all 500ms ease; | |
-moz-transition: all 500ms ease; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Slug maker | |
//=================================== | |
function slugify (value) { | |
return value.toString().toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/_/g, '-') // Replace underscores with - | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - | |
.replace(/^-+/, '') // Trim - from start of text | |
.replace(/-+$/, ''); // Trim - from end of text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $wp; | |
$current_url = home_url(add_query_arg(array(),$wp->request)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This function checks if the page you're on is a certain page | |
* @param $slug the slug of the page you are checking for | |
*/ | |
function is_this_page($slug) { | |
$current_url = home_url(add_query_arg(array())); | |
if (false !== strpos($current_url, $slug)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ==================================================== | |
// -- HANDY REDIRECT FUNCTION | |
// -- Takes in 2 param: | |
// -- 1. String: slug and parent eg: parent-page/child-page/ | |
// -- 2. Boolean: if it's just the slug or the full url | |
// -- 3. Array of strings: Any Exceptions | |
// ==================================================== | |
function go_to( $destination, $full_url, $exceptions ) { |