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(){ | |
$(".navtab>li").click(function(){ | |
$(this).addClass('selected').siblings().removeClass('selected'); | |
}); | |
}); | |
// From http://stackoverflow.com/questions/12606784/jquery-add-and-remove-class-on-a-menu |
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
$numposts = wp_count_posts('post'); | |
echo $numposts->publish; | |
// From http://wordpress.org/support/topic/get-pount-position-in-total-post-count?replies=5 |
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
class MY_Post_Numbers { | |
private $count = 0; | |
private $posts = array(); | |
public function display_count() { | |
$this->init(); // prevent unnecessary queries | |
$id = get_the_ID(); | |
echo sprintf( '<div class="post-counter">Post number<span class="num">%s</span><span class="slash">/</span><span class="total">%s</span></div>', $this->posts[$id], $this->count ); | |
} |
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.getBoundingClientRect(); // Get position in viewport coordinates | |
// From http://stackoverflow.com/questions/1567327/using-jquery-to-get-elements-position-relative-to-viewport |
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 pa_admin_area_favicon() { | |
echo '<link rel="shortcut icon" href="http://cdn.alex.leonard.ie/favicon.ico" />'; | |
} | |
add_action('admin_head', 'pa_admin_area_favicon'); | |
// From http://alex.leonard.ie/2012/05/24/wordpress-admin-area-favicon/ |
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
.second { | |
.first ~ & { | |
/* styles to be applied to .second if a .first exists at the same node level */ | |
} | |
} | |
// From http://stackoverflow.com/questions/15246387/css-and-or-sass-sibling-selector-upwards |
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
$ git rm -r --cached .idea | |
#From https://coderwall.com/p/qaiaog |
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 () { | |
$('.around li').hover(function () { | |
var index = $('.around li').index(this); | |
console.log(index); | |
}, function () { }); | |
}); | |
// From http://stackoverflow.com/questions/11294012/jquery-get-index-of-hovered-li |
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
var is_safari = navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1 && navigator.userAgent.indexOf('Android') == -1; | |
if (is_safari) { | |
// /* On folder hover lower featured image z-index and almost hide all folder icons */ | |
$('.folder-image').hover(function() { | |
}, function() { | |
}); | |
} |
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
html { | |
/* This has to be added to html CSS */ | |
overflow: hidden; | |
} | |
body { | |
overflow-x: hidden; | |
} | |
/* From http://stackoverflow.com/questions/17767176/overflow-x-value-ignored-in-mobile-safari */ |