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
// Define your plugins here, make sure you have `gulp-util`... | |
var gutil = require('gulp-util'); | |
/** | |
* Define dev CLI flag | |
* Run `gulp --dev` | |
*/ | |
var isDev = gutil.env.dev; | |
gulp.task('scripts', function() { |
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 | |
// All scripts to load here | |
function load_scripts() { | |
// Register script | |
wp_register_script('scrollup', get_template_directory_uri() . '/path/to/scripts/jquery.scrollUp.min.js', array('jquery'), '2.3.3', true ); | |
// Enqueue it | |
wp_enqueue_script('scrollup'); |
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 | |
add_filter( 'nav_menu_css_class', 'add_parent_url_menu_class', 10, 2 ); | |
function add_parent_url_menu_class( $classes = array(), $item = false ) { | |
// Get current URL | |
$current_url = current_url(); | |
// Get homepage URL |
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
gulp.task('static', function() { | |
return gulp.src('src/static/**') | |
.pipe(gulp.dest('build')); | |
} |
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
function extend (target, source) { | |
var a = Object.create(target); | |
Object.keys(source).map(function (prop) { | |
a[prop] = source[prop]; | |
}); | |
return a; | |
}; |
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
<p>Normal</p> | |
<a class="btn btn--primary">Button</a> | |
<a class="btn btn--primary btn--outline">Button</a> | |
<a class="btn btn--secondary">Button</a> | |
<a class="btn btn--secondary btn--outline">Button</a> | |
<a class="btn btn--tertiary">Button</a> | |
<a class="btn btn--tertiary btn--outline">Button</a> |
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
<p>Normal</p> | |
<a class="btn btn--primary">Button</a> | |
<a class="btn btn--primary btn--outline">Button</a> | |
<a class="btn btn--secondary">Button</a> | |
<a class="btn btn--secondary btn--outline">Button</a> | |
<a class="btn btn--tertiary">Button</a> | |
<a class="btn btn--tertiary btn--outline">Button</a> |
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
{# Get the IDs of all the sections #} | |
{% set currentSectionId = entry.id %} | |
{% set allSectionIds = craft.entries.section('myStructure').level(1).ids() %} | |
{# Define var before loop #} | |
{% set sectionNumber = '' %} | |
{# Loop through all section IDs and find the one that matches the current #} | |
{% for key, sectionId in allSectionIds if sectionId == currentSectionId %} |
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
{ | |
onStick: function () { | |
document.querySelector('.img-elem').src = '/path/to/stick-img.png' | |
}, | |
onUnstick: function () { | |
document.querySelector('.img-elem').src = '/path/to/unstick-img.png' | |
}, | |
} |
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
var noRepeat = function () { | |
return function (css) { | |
css.eachDecl('background-repeat', function (decl) { | |
if (decl.value.indexOf('none') !== -1) { | |
decl.value = 'no-repeat'; | |
} | |
}); | |
}; | |
}; |
OlderNewer