This file contains hidden or 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 if ( wp_is_mobile() ) { | |
// Do something for mobile devices | |
} else { | |
// Do something for desktop | |
} |
This file contains hidden or 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
/* Close the Yoast metabox */ | |
function shut_your_mouth_yoast() { | |
echo '<script>jQuery( document ).ready(function() { jQuery(".yoast.wpseo-metabox").addClass("closed"); });</script>'; | |
} | |
add_action( 'admin_head', 'shut_your_mouth_yoast' ); |
This file contains hidden or 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 enqueue_select2_jquery() { | |
wp_register_style( 'select2css', '//cdnjs.cloudflare.com/ajax/libs/select2/3.4.8/select2.css', false, '1.0', 'all' ); | |
wp_register_script( 'select2', '//cdnjs.cloudflare.com/ajax/libs/select2/3.4.8/select2.js', array( 'jquery' ), '1.0', true ); | |
wp_enqueue_style( 'select2css' ); | |
wp_enqueue_script( 'select2' ); | |
} | |
add_action( 'admin_enqueue_scripts', 'enqueue_select2_jquery' ); |
This file contains hidden or 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
jQuery('.my-button').click(function() { | |
if(jQuery(this).prop('checked')) { | |
jQuery('.my-checkbox').removeAttr('disabled'); | |
} else { | |
jQuery('.my-checkbox').attr('disabled', 'disabled'); | |
} | |
}); |
This file contains hidden or 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
The MIT License (MIT) | |
Copyright (c) James Dennes | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
This file contains hidden or 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
<script> | |
// Actual waypoint script. Save into waypoint.js | |
/*! | |
Waypoints - 4.0.0 | |
Copyright © 2011-2015 Caleb Troughton | |
Licensed under the MIT license. | |
https://github.com/imakewebthings/waypoints/blob/master/licenses.txt | |
*/ | |
! function() { |
This file contains hidden or 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
{% assign collection_handle = 'the-handle-of-collection-you-want' %} | |
{% for product in collections[collection_handle].products %} | |
Do your stuff | |
{% endfor %} |
This file contains hidden or 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
<h1> | |
<span>This is a test</span> | |
</h1> | |
<style> | |
h1 span { | |
-webkit-text-fill-color: transparent; /* Chrome Only */ |
This file contains hidden or 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
$(window).scroll(function() { | |
if ($(document).scrollTop() > 100) { | |
$('.header').addClass('scrolled'); | |
} | |
else { | |
$('.header').removeClass('scrolled'); | |
} | |
}); |