Skip to content

Instantly share code, notes, and snippets.

View hlashbrooke's full-sized avatar
🎲

Hugh Lashbrooke hlashbrooke

🎲
View GitHub Profile
@hlashbrooke
hlashbrooke / custom.css
Created May 18, 2015 08:21
Custom CSS for WordCamp Cape Town 2013 using Twenty Twelve as a base: https://capetown.wordcamp.org/2013/ - useful for getting a new WordCamp site design off the ground more quickly.
/*
* Custom CSS for WordCamp Cape Town 2013
* Base theme: Twenty Twelve
*/
html {
background: #000000;
}
body.custom-font-enabled {
*Talk title & abstract submitted for ScaleConf 2016: http://scaleconf.org/*
# Scaling Community
Working with any language or platform throws you into the community surrounding it whether you like it or not (even more so if it's an open-source platform), but how do you effectively engage with that community as your business grows? Do you even need to engage with it? What about user groups - are they worth it? Is joining one enough? Should you contribute anything back to the project itself - is that even worthwhile? And when have you done enough? What does it ultimately mean to belong to a technology community?
In this talk, we’ll look at how an empowered community enabled WordPress to grow to dominate 24.9% of the internet, along with a few case studies such as the exponential growth of the community surrounding WooCommerce and what that has done for the growth of the product itself.
## Bio
Hugh Lashbrooke is long-time member of both the PHP and WordPress communities. As the Woo Community Engagement Manager
@hlashbrooke
hlashbrooke / functions.php
Created November 7, 2015 05:16
Seriously Simple Podcasting: Add episodes series to episode meta data
add_filter( 'ssp_episode_meta_details', 'ssp_series_title_in_meta', 10, 3 );
function ssp_series_title_in_meta ( $meta, $episode_id, $context ) {
$series_title = get_the_term_list( $episode_id, 'series', 'Series: ', ', ' );
$meta['series'] = $series_title;
return $meta;
}
@hlashbrooke
hlashbrooke / cache-exclusion
Last active November 11, 2015 11:41
Seriously Simple Podcasting: String to exclude episode files from W3 Total Cache as well as WP Super Cache
/podcast-download/.+
/podcast-player/.+
@hlashbrooke
hlashbrooke / style.css
Created April 10, 2013 13:22
CSS transforms on catherinelashbrooke.com
#polaroid1 {
top: 55px;
left: 44px;
transform: rotate(-10deg);
-webkit-transform: rotate(-10deg);
-ms-transform: rotate(-10deg);
-moz-transform: rotate(-10deg);
-o-transform: rotate(-10deg);
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1.5);
}
@hlashbrooke
hlashbrooke / function.php
Created June 26, 2013 12:01
Adding filter to woocommerce_prevent_admin_access()
function woocommerce_prevent_admin_access() {
$prevent_access = false;
if ( get_option('woocommerce_lock_down_admin') == 'yes' && ! is_ajax() && ! ( current_user_can('edit_posts') || current_user_can('manage_woocommerce') ) ) {
$prevent_access = true;
}
$prevent_access = apply_filters( 'woocommerce_prevent_admin_access', $prevent_access );
@hlashbrooke
hlashbrooke / snippet.php
Last active December 19, 2015 12:29
WooThemes Tweets widget
<?php if ( $woo_options['woo_twitter'] ) { ?>
<div id="twitter"<?php if ( $woo_options['woo_sub'] <> "true" ) echo ' class="twitter-if"'; ?>>
<a href="http://www.twitter.com/<?php echo urlencode( $woo_options['woo_twitter'] ); ?>" title="<?php esc_attr_e( 'Follow us on Twitter', 'woothemes' ); ?>" class="fl" ><img src="<?php bloginfo('template_directory'); ?>/images/ico-twitter.png" alt="" /></a>
<?php if ( class_exists( 'WooDojo_Widget_Tweets' ) ) {
the_widget( 'WooDojo_Widget_Tweets', array( 'twitter_handle' => esc_attr( $woo_options['woo_twitter'] ), 'limit' => 1, array( 'before_widget' => '<div id="twitter_update_list" class="twitter_container">', 'after_widget' => '</div>' ) );
} ?>
</div>
<?php } ?>
@hlashbrooke
hlashbrooke / .gitignore
Created July 12, 2013 11:02
A .gitignore file for multiple site in one repo
.htaccess
wp-admin/
wp-includes/
wp-config.php
*/wp-content/uploads/
*/wp-content/blogs.dir/
*/wp-content/upgrade/
*/wp-content/backup-db/
*/wp-content/advanced-cache.php
*/wp-content/wp-cache-config.php
@hlashbrooke
hlashbrooke / function.js
Created July 12, 2013 11:03
Simplest jQuery method for selecting all checkboxes in a form
$( '.selectall' ).click( function () {
$( this ).closest( 'form' ).find( ':checkbox' ).attr( 'checked' , this.checked );
});
@hlashbrooke
hlashbrooke / add_widget_area.php
Created July 12, 2013 11:10
WordPress: Create a new widget area
<?php
function register_widget_area() {
register_sidebar( array(
'name' => 'Widget Area Name',
'id' => 'new_widget_area',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h1 class="title">',
'after_title' => '</h1>',
) );