A Pen by Markus Schober on CodePen.
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
@mixin parent($selector: null) { | |
@if $selector { | |
#{$selector} & { | |
@content; | |
} | |
} | |
} | |
@mixin and_parent($selector: null) { |
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 ARC4RANDOM_MAX 0x100000000 | |
double val = ((double)arc4random() / ARC4RANDOM_MAX) | |
* (maxRange - minRange) | |
+ minRange; |
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
/** | |
* Retrieve by its slug | |
* @param string $slug Slug of the post | |
* @param string $post_type Post Type | |
* @param string $output Type of output | |
* @return mixed | |
* @author Markus Schober | |
*/ | |
function bb_get_post_by_slug($slug, $post_type = 'post', $output = 'OBJECT') { | |
global $wpdb; |
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 a page ID by slug | |
* @param $page_slug | |
* | |
* @return int|null | |
*/ | |
function bb_get_page_id_by_slug($page_slug) { | |
$page = get_page_by_path($page_slug); | |
if ($page) { | |
return $page->ID; |
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
.mobile-nav-toggler { | |
@include prefixer(transform, rotate(0deg), webkit moz ms o spec); | |
@include transition(all 0.5s ease-in-out); | |
cursor: pointer; | |
height: 21px; | |
position: absolute; | |
right: 0; | |
top: 22px; | |
width: 30px; |
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
if ( ! function_exists('bb_tribe_events_before_html_filter')) { | |
/** | |
* Replace the events calender loading gif | |
* @param $before | |
* | |
* @return mixed | |
* @author Markus Schober | |
*/ | |
function bb_tribe_events_before_html_filter($before) { |
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
/** | |
Adds an animated underline hover effect | |
a { | |
@include animated-underline(#000000); | |
// your styles here | |
} | |
*/ | |
@mixin animated-underline($color: $color__link, $bottom: 3px, $height: 1px) { | |
position: relative; | |
display: inline-block; |
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
// Auto scroll | |
// ------------------------------------- | |
$('a[href^=#]').on('click', function(e) { | |
e.preventDefault(); | |
var $this = $(this), | |
target = $this.attr('href'); | |
if(target && target !== "#") { | |
$('html, body').animate({ |
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 | |
/** | |
* Echo an ACF Field if it is present | |
* @param bool|int $field Name of the field | |
* @param string $before prepend the field with this string. HTML for example | |
* @param string $after append the field with this string. HTML for example | |
* @param bool|int $post_id | |
* | |
* @return bool|void |