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
# ignore everything in the root except the "wp-content" directory. | |
/* | |
!wp-content/ | |
# ignore everything in the "wp-content" directory, except: | |
# plugins and themes directories | |
wp-content/* | |
!wp-content/plugins/ | |
!wp-content/themes/ | |
wp-content/themes/twenty* |
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
/** | |
* Exclude featured posts from main blog loop | |
*/ | |
function bt_exclude_featured_from_blog_index( $query ) { | |
if ( ! is_admin() && $query->is_home() && $query->is_main_query() ) { | |
$post_ids = bt_featured_post_ids(); | |
if ( ! empty( $post_ids ) ) { | |
$query->set( 'post__not_in', $post_ids ); | |
} | |
} |
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
// ScrollMagic | |
const controller = new ScrollMagic.Controller(); | |
// Animate an object to a y or x value | |
// Usage: data-to-target="y:-100" | |
// Optional: data-to-target-mobile="y:-50" (requires SSM) | |
// Optional: data-duration="50%" | |
// Optional: data-trigger-element="#someDiv" (defaults to parent) | |
$('[data-to-target]').each(function() { | |
const $this = $(this); |
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
// ScrollMagic | |
const controller = new ScrollMagic.Controller(); | |
// Animate an object to a y or x value | |
// Usage: data-to-target="y:-100" | |
// Optional: data-to-target-mobile="y:-50" (requires SSM) | |
// Optional: data-duration="50%" | |
// Optional: data-trigger-element="#someDiv" (defaults to parent) | |
// Optional: Adjust animation offset using data-animation-offset="X" | |
$('[data-to-target]').each(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 | |
/* | |
Usage: the_field_srcset('field_name'); | |
ACF field should return Image ID. | |
*/ | |
function the_field_srcset($field, $before='', $after='', $size = 'full', $echo = true) { | |
if (get_field($field)) { | |
$img = wp_get_attachment_image(get_field($field), $size); | |
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 | |
function is_blog_page($single=true, $four04=true) { | |
if ((is_home() || is_archive() || is_search()) && !is_post_type_archive()) { | |
return true; | |
} | |
if ($single === true && is_singular('post')) { | |
return true; | |
} |
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
/* | |
back to top | |
usage: $('#main').backtotop(); | |
use localScroll plugin for smooth scrolling | |
style in CSS. | |
*/ | |
;(function($) { | |
$.fn.backtotop = function(options) { |
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
/* | |
vadjust plugin. | |
adjust top margin on vertically centered elements. | |
var $vadj = $('[data-vadjust="true"]'); | |
if ($vadj.length > 0) { $vadj.vadjust(); } | |
*/ | |
;(function($) { | |
$.fn.vadjust = function(options) |
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($) { | |
$.fn.scrollclass = function(options) { | |
var opts = $.extend({}, $.fn.scrollclass.defaults, options), | |
$this = this, | |
state2 = false; | |
$(document) | |
.scroll(function() { | |
if (state2 == false && $(this).scrollTop() > opts.pos) { | |
state2 = true; |
NewerOlder