Skip to content

Instantly share code, notes, and snippets.

View DigitalEssence's full-sized avatar

Hedley Phillips DigitalEssence

View GitHub Profile
@DigitalEssence
DigitalEssence / gist:55575d8725997c3c55dd
Created February 18, 2015 10:35
WordPress - Enfold - Make the Content full width of a boxed layout
/* Make the content full width of the boxed section */
.container_wrap.fullsize .container {
padding-left: 0px !important;
padding-right: 0px !important;
}
@DigitalEssence
DigitalEssence / gist:7bae0ce6fed5a85ef77b
Created February 18, 2015 10:47
CSS - Responsive background image
#newsletter_sign_up {
max-width: 272px;
height: 329px;
background-image: url("/wp-content/uploads/2015/01/newsletter_signup.png");
background-size: 100% 100%;
}
@DigitalEssence
DigitalEssence / gist:cc5e6bd4ee53bc1fc54b
Created February 18, 2015 10:40
CSS - Add a border and drop shadow to an element
.av-catalogue-image {
border-radius: 0;
width: 490px;
height: 340px;
/*This adds the border, in this a 5px white border */
padding: 5px;
/*This adds the drop shadow */
-webkit-box-shadow: 6px 6px 20px -1px rgba(189,189,189,1);
-moz-box-shadow: 6px 6px 20px -1px rgba(189,189,189,1);
box-shadow: 6px 6px 20px -1px rgba(189,189,189,1);
@DigitalEssence
DigitalEssence / gist:d238bbb5cb6ebc6dd338
Created February 18, 2015 10:37
CSS - Enfold - Remove default background on hover in footer links
.widget_nav_menu ul:first-child>.current-menu-item, .widget_nav_menu ul:first-child>.current_page_item, .widget_nav_menu ul:first-child>.current-menu-ancestor {
padding-left: 0;
left: 0;
box-shadow: none;
background-color: transparent!important;
}
@DigitalEssence
DigitalEssence / gist:1bb742955ff8960cfe39
Created February 18, 2015 10:36
CSS - Enfold - Change current page menu link colour
/* Change current page menu colour */
.header_color .main_menu ul:first-child > li.current-menu-item > a, .header_color .main_menu ul:first-child > li.current_page_item > a {color: #fff!important;}
@DigitalEssence
DigitalEssence / gist:faf84e2ee33a4939e545
Created February 18, 2015 10:28
Wordpress - Add Custom Image Size to Admin Area
//////////////////////////////////
// Add new image size to WordPress
//////////////////////////////////
add_image_size( 'catalog', 490, 340, array( 'center', 'top' ) ); // Hard crop center top
// make the new size available in the media library (and image element etc.)
add_filter( 'image_size_names_choose', 'my_custom_images' );
function my_custom_images( $sizes ) {
return array_merge( $sizes, array(
'catalog' => __( 'Catalogue Image' ),
) );
@DigitalEssence
DigitalEssence / gist:e18f3d892aa4831d0a18
Created February 18, 2015 10:29
Enfold - Enable Shortcodes in Child Theme
//////////////////////////////////
// Enable Shortcodes to be used in the child theme
//////////////////////////////////
add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1);
function avia_include_shortcode_template($paths)
{
$template_url = get_stylesheet_directory();
array_unshift($paths, $template_url.'/shortcodes/');
return $paths;
@DigitalEssence
DigitalEssence / gist:42ec2b076b96e481a737
Created February 18, 2015 10:30
WooCommerce - Add short description to the product loop
// Add short description to the product loop
add_action('woocommerce_after_shop_loop_item_title','woocommerce_template_single_excerpt', 5);
@DigitalEssence
DigitalEssence / gist:02091ec16309117715ef
Created February 18, 2015 10:31
Reduce the Latest News Widget excerpt to X words
/* Reduce the Latest News Widget excerpt to X words */
function custom_excerpt_length( $length ) {
return X;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
@DigitalEssence
DigitalEssence / gist:f101fe6893fc4777c737
Last active August 29, 2015 14:15
CSS - Full Screen background image
/* add a fixed, full screen background image */
html {
background: url(/wp-content/uploads/2015/04/background.jpg) no-repeat left top fixed!important;
-webkit-background-size: cover!important;
-moz-background-size: cover!important;
-o-background-size: cover!important;
background-size: cover!important;
}