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 FEATURED IMAGE | |
function ST4_get_featured_image($post_ID) { | |
$post_thumbnail_id = get_post_thumbnail_id($post_ID); | |
if ($post_thumbnail_id) { | |
$post_thumbnail_img = wp_get_attachment_image_src($post_thumbnail_id, 'featured_preview'); | |
return $post_thumbnail_img[0]; | |
} | |
} |
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 | |
$attachments = get_posts( array( | |
'post_type' => 'attachment', | |
'posts_per_page' => -1, | |
'post_parent' => $post->ID, | |
'exclude' => get_post_thumbnail_id(), | |
'orderby' => 'menu_order', | |
'order' => 'ASC' | |
) ); |
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
75% opacity: | |
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlPCNYx7+gAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII= |
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 seoUrl($string, $separator = '-') { | |
$accents_regex = '~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml);~i'; | |
$special_cases = array( '&' => 'and', "'" => ''); | |
$string = mb_strtolower( trim( $string ), 'UTF-8' ); | |
$string = str_replace( array_keys($special_cases), array_values( $special_cases), $string ); | |
$string = preg_replace( $accents_regex, '$1', htmlentities( $string, ENT_QUOTES, 'UTF-8' ) ); | |
$string = preg_replace("/[^a-z0-9]/u", "$separator", $string); | |
$string = preg_replace("/[$separator]+/u", "$separator", $string); | |
return $string; |
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
#element{ | |
-webkit-transition: all 350ms ease; | |
-moz-transition: all 350ms ease; | |
-o-transition: all 350ms ease; | |
transition: all 350ms ease; | |
} |
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 ($(this).scrollTop() > 100) { | |
... | |
} else { | |
... | |
} | |
}); |
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
.transition (@transition) { | |
-webkit-transition: @transition; | |
-moz-transition: @transition; | |
-ms-transition: @transition; | |
-o-transition: @transition; | |
} |
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 | |
/* | |
Template Name: List | |
*/ | |
?> | |
<style> | |
td, tr{ | |
border: 1px solid grey; | |
padding: 10px; |
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
$(document).ready(function(){ | |
var today = new Date(); | |
var day = today.getDate(); | |
var month = today.getMonth()+1; //January is 0! | |
var year = today.getFullYear(); | |
if(day < 10) { | |
day = '0' + day | |
} |
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
function between(x, min, max) { | |
return x >= min && x <= max; | |
} |