Skip to content

Instantly share code, notes, and snippets.

Josh Medeski joshmedeski

Block or report user

Report or block joshmedeski

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@joshmedeski
joshmedeski / mpu-links.md
Created Nov 13, 2015
2015 SassConf Unconference Mac Power Users Links
View functions.php
<?php
/**
* Count number of widgets in a sidebar
* Used to add classes to widget areas so widgets can be displayed one, two, three or four per row
*/
function slbd_count_widgets( $sidebar_id ) {
// If loading from front page, consult $_wp_sidebars_widgets rather than options
// to see if wp_convert_widget_settings() has made manipulations in memory.
global $_wp_sidebars_widgets;
@joshmedeski
joshmedeski / gist:9099487
Created Feb 19, 2014
GENERATE SAFE TEXT COLORS WITH SASS
View gist:9099487
$lightness-bound : 70 !global;
$hue-bound-bottom : 40 !global;
$hue-bound-top : 200 !global;
@function checkDangerZone($color) {
@if ( (lightness($color) > $lightness-bound) or (hue($color) > $hue-bound-bottom and hue($color) < $hue-bound-top )) {
@return darken(desaturate($color, 70), 60);
}
@else {
@joshmedeski
joshmedeski / gist:7981565
Last active Dec 31, 2015
wp: header title
View gist:7981565
<!-- Title Credit: http://perishablepress.com/how-to-generate-perfect-wordpress-title-tags-without-a-plugin/ -->
<title>
<?php if (function_exists('is_tag') && is_tag()) {
echo 'Tag Archive for &quot;'.$tag.'&quot; — ';
}
elseif (is_archive()) {
wp_title(''); echo ' Archive — ';
}
elseif (is_search()) {
echo 'Search for &quot;'.wp_specialchars($s).'&quot; — ';
You can’t perform that action at this time.