Skip to content

Instantly share code, notes, and snippets.

View hlashbrooke's full-sized avatar
🎲

Hugh Lashbrooke hlashbrooke

🎲
View GitHub Profile
@hlashbrooke
hlashbrooke / function1.php
Created October 16, 2014 12:21
Create a shortcode in WordPress
<?php
function shortcode_function( $params ) {
return "Shortcode content";
}
add_shortcode( 'shortcode_name', 'shortcode_function' );
?>
@hlashbrooke
hlashbrooke / style.css
Last active August 29, 2015 14:10
Improved content image display for Twenty Fifteen
.entry-content img {
box-shadow: 0px 0 15px 5px #ccc;
}
.entry-content .wp-caption-text {
text-align: center;
}
@hlashbrooke
hlashbrooke / function.php
Last active August 29, 2015 14:13
Add appreciation links to your plugins in the plugin list table
<?php
add_filter( 'plugin_row_meta', 'plugin_appreciation_links', 10, 4 );
function plugin_appreciation_links ( $plugin_meta = array(), $plugin_file = '', $plugin_data = array(), $status = '' ) {
$plugin_slug = 'seriously-simple-podcasting';
$donate_link = 'http://www.hughlashbrooke.com/donate';
if( ! isset( $plugin_data['slug'] ) || $plugin_slug != $plugin_data['slug'] ) {
return $plugin_meta;
@hlashbrooke
hlashbrooke / functions.php
Last active August 29, 2015 14:14
Seriously Simple Podcasting: Modify number of episodes that appear in podcast RSS feed
add_filter( 'ssp_feed_number_of_posts', 'ssp_modify_number_of_posts_in_feed' );
function ssp_modify_number_of_posts_in_feed ( $n ) {
return 25; // Where 25 is the number of episodes that you would like to include in your RSS feed
}
@hlashbrooke
hlashbrooke / functions.php
Last active August 29, 2015 14:14
Seriously Simple Podcasting: Switch off the use of post tags on podcast episodes
add_filter( 'ssp_use_post_tags', '__return_false' );
@hlashbrooke
hlashbrooke / function.php
Last active August 29, 2015 14:15
Seriously Simple Podcasting: Get audio player for specific episode.
global $ss_podcasting;
$audio_player = $ss_podcasting->episode_meta( $episode_id );
@hlashbrooke
hlashbrooke / Slack theme for ZA Tech
Last active August 29, 2015 14:18
Slack theme for ZA Tech. To use this theme, go to the 'Sidebar Theme' tab in your preferences pane and add this text to the custom theme field.
#007C59,#FCB514,#E23D28,#FFFFFF,#0C1C8C,#FFFFFF,#0C1C8C,#FCB514
@hlashbrooke
hlashbrooke / Slack theme for WooThemes
Created March 30, 2015 07:56
Slack theme for WooThemes. To use this theme, go to the 'Sidebar Theme' tab in your preferences pane and add this text to the custom theme field.
#42A2CE,#255A8C,#71B02F,#FFFFFF,#255A8C,#E6E6E6,#71B02F,#71B02F
@hlashbrooke
hlashbrooke / functions.php
Created April 23, 2015 12:07
WordPress: Add oEmbed support for Speaker Deck presentations.
add_action( 'init', 'add_speakerdeck_oembed' );
function add_speakerdeck_oembed() {
wp_oembed_add_provider( 'https://speakerdeck.com/*/*', 'https://speakerdeck.com/oembed.json' );
}
@hlashbrooke
hlashbrooke / custom.css
Created May 18, 2015 08:20
Custom CSS for WordCamp Cape Town 2014 using Twenty Twelve as the base: https://capetown.wordcamp.org/2014/ - useful for getting a new WordCamp site design off the ground more quickly.
/*
* Custom CSS for WordCamp Cape Town 2014
* Base theme: Twenty Twelve
*/
/* Menu tickets link highlight (change ID once menu item is live) */
#menu-item-283629 a {
font-weight: bold;
color: #d54e21;
border-bottom: 2px solid #d54e21;