View _wpadmin_functions.php
<?php | |
/** | |
* Admin customizations | |
*/ | |
// Change the goofy "Howdy" greeting | |
function remove_howdy( $translated, $text, $domain ) { | |
if ( !is_admin() || 'default' != $domain ) | |
return $translated; | |
if ( false !== strpos($translated, 'Howdy') ) |
View _smooth-scroll.js
// Smooth scroll to page anchors | |
$(function() { | |
$('a[href*=#]:not([href=#])').click(function() { | |
if (location.pathname.replace(/^\//,'') === this.pathname.replace(/^\//,'') && location.hostname === this.hostname) { | |
var target = $(this.hash); | |
target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); | |
if (target.length) { | |
$('html,body').animate({ | |
scrollTop: target.offset().top | |
}, 1000); |
View _custom-mixins.scss
// Top left block to see what breakpoint you are on. | |
.mq-block { | |
position: fixed; | |
top: 0; | |
left: 0; | |
width: 10px; | |
height: 10px; | |
content: " "; | |
z-index: 999999; | |
} |
View gist:bda91a9e963e40110667
<?php | |
$attachments = get_children(array( | |
'post_parent' => $post->ID, | |
'post_status' => 'inherit', | |
'post_type' => 'attachment', | |
'post_mime_type' => 'image', | |
'order' => 'ASC' | |
)); | |
$i = 0; |
View gist:141ed124cc586f0c0eda
<?php | |
$galleries = get_post_galleries( $post, FALSE ); | |
$i = 0; | |
foreach ( $galleries as $key => $gallery) { | |
$images = $gallery['src']; | |
foreach ($images as $key => $img) { | |
if( $i < 4 ) { | |
echo '<img src="' . $img . '" alt="">'; | |
} | |
$i++; |
View Get computed CSS styles with jQuery
/* | |
Grab CSS styles with jQuery... | |
To call it: | |
getStyle(document.getElementById("container"), "font-size") | |
*/ | |
function getStyle(oElm, strCssRule){ | |
var strValue = ""; | |
if(document.defaultView && document.defaultView.getComputedStyle){ | |
strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule); |