Estimated time: 10 minutes
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
.acf-fc-popup .preview { | |
position: absolute; | |
right: 100%; | |
margin-right: 0px; | |
top: 0; | |
background: #383c44; | |
min-height: 100%; | |
border-radius: 5px; | |
align-content: center; | |
display: grid; |
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
setInterval(function() { | |
Array.prototype.slice.call(document.querySelectorAll('[data-reactid]')) | |
.forEach(function(element) { | |
element.style.background = 'rgba(255,0,0,0.1)'; | |
}) | |
}, 500) |
After reading through this guide, you will:
- Understand the Roots Wrapper and recognize how it extends and complements the WordPress template hierarchy.
- Know what is meant by the DRY Principle, why being DRY bests being WET, and see how most WordPress themes are WET.
- Be able to filter the Roots Wrapper and create a new base template for a Custom Post Type.
WordPress is pretty smart. Every time you load up a request it will search for the most relevant template available in your theme and load it. This is the Template Hierarchy in action and it enables us to easily customize the appearance of our sites.
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
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script> | |
<script src="/js/waypoints.min.js"></script> | |
<script> | |
$(function() { | |
var promo = $('#promo'), | |
speed = 500; //speed in ms | |
$('.promo-hook').waypoint(function(direction){ | |
if (direction === "down") { | |
promo.slideDown(speed); |
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
// found here http://forums.shopify.com/categories/2/posts/29259 | |
var getOrdinal = function(n) { | |
var s=["th","st","nd","rd"], | |
v=n%100; | |
return n+(s[(v-20)%10]||s[v]||s[0]); | |
} |