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
import { TweenLite } from 'gsap'; | |
const DEFAULT_DURATION = 0.3; | |
export const hideElement = (el, speed = DEFAULT_DURATION) => { | |
const oldSpacing = { height: el.clientHeight }; | |
const newSpacing = { height: 0 }; | |
const additionalSpacingProperties = ['paddingTop', 'paddingBottom', 'marginTop', 'marginBottom']; | |
additionalSpacingProperties.forEach(property => { |
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 | |
/** | |
* Gets the next post in the current post type, even if is last post | |
* Inspired from https://gist.github.com/banago/5603826 | |
* | |
* @method get_next_post_looped | |
* @return WordPress Post Object | |
*/ | |
function get_next_post_looped() { | |
$post_type = get_post_type(); |
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 following mixin works when @include[ed] onto a div containing three empty spans: | |
<div class="animated-hamburger"> | |
<span></span> | |
<span></span> | |
<span></span> | |
</div> | |
To get the animation on click, use the following 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
<?php | |
/** | |
* Get first paragraph from a WordPress post. Use inside the Loop. | |
* | |
* @return string | |
*/ | |
function get_first_paragraph(){ | |
global $post; | |
$str = wpautop( get_the_content() ); |