Skip to content

Instantly share code, notes, and snippets.

View jamiebrwr's full-sized avatar

Jamie Brewer jamiebrwr

View GitHub Profile
@dumindu
dumindu / gist:3359218
Created August 15, 2012 11:14 — forked from acconrad/gist:3350416
How to target mobile devices with CSS Media Queries
@media only screen and (-webkit-device-pixel-ratio: .75) {
/* CSS for Low-density Android screens goes here *
* Ex: HTC Evo, HTC Incredible, Nexus One */
}
@media only screen and (-webkit-device-pixel-ratio: 1) and (max-device-width: 768px) {
/* CSS for Medium-density Android screens goes here *
* Ex: Samsung Ace, Kindle Fire, Macbook Pro *
* max-device-width added so you don't target laptops and desktops */
}
@mikejolley
mikejolley / gist:3206230
Created July 30, 2012 11:10
Woo Breadcrumbs product categories, by Matt
// Add product categories to the "Product" breadcrumb in WooCommerce.
// Get breadcrumbs on product pages that read: Home > Shop > Product category > Product Name
add_filter( 'woo_breadcrumbs_trail', 'woo_custom_breadcrumbs_trail_add_product_categories', 20 );
function woo_custom_breadcrumbs_trail_add_product_categories ( $trail ) {
if ( ( get_post_type() == 'product' ) && is_singular() ) {
global $post;
$taxonomy = 'product_cat';
@johnpbloch
johnpbloch / protected-roles.php
Created March 13, 2012 14:07
Define 'protected' WordPress roles that can only be deleted by users of at least one protected role. This allows you to enable clients to create, edit, and delete users without deleting your account.
<?php
class JPB_User_Caps {
/**
* An array of all protected roles
* @var array
*/
protected $protectedRoles = array(
'webmaster',