A Pen by Markus Schober on CodePen.
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
@mixin parent($selector: null) { | |
@if $selector { | |
#{$selector} & { | |
@content; | |
} | |
} | |
} | |
@mixin and_parent($selector: null) { |
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
#define ARC4RANDOM_MAX 0x100000000 | |
double val = ((double)arc4random() / ARC4RANDOM_MAX) | |
* (maxRange - minRange) | |
+ minRange; |
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
/** | |
* 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 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
/** | |
* 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 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
.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 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
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 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 ( ! function_exists( 'redirect_post_type_archive' ) ) { | |
/** | |
* Redirect to 404 if we are querying an post_type archive, we won't | |
* @author Markus Schober | |
*/ | |
function redirect_post_type_archive() { | |
global $wp_query, $post; | |
if (is_post_type_archive(array('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
/** | |
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; |