Skip to content

Instantly share code, notes, and snippets.

tomhemsley

Block or report user

Report or block tomhemsley

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Meta Slider Post Feed AND
function metaslider_post_feed_and( $args, $slide, $slider_settings, $slide_settings ) {
if ( isset( $args['tax_query'][0] ) ) {
$args['tax_query'][0]['operator'] = 'AND';
}
return $args;
}
add_filter( 'metaslider_post_feed_args', 'metaslider_post_feed_and', 10, 4);
@tomhemsley
tomhemsley / gist:58387b44303a7214cbd5
Created Mar 7, 2016
Meta Slider Rocket Loader (TEST)
View gist:58387b44303a7214cbd5
add_filter( 'script_loader_tag', 'disable_async_for_rocket_loader', 11, 2 );
function disable_async_for_rocket_loader( $tag, $handle ) {
if ( strpos( $handle, 'metaslider' ) !== FALSE ) {
$tag = str_replace( "<script type='text/javascript'", "<script data-cfasync='false'", $tag );
}
return $tag;
}
View gist:df6deaad7ecc4fcdc37f
function ms_vimeo_loop_and_https($url, $slider_id, $slide_id) {
return "https:" . $url . "&loop=1";
}
add_filter('metaslider_vimeo_params', 'ms_vimeo_loop_and_https', 10, 3);
@tomhemsley
tomhemsley / gist:00df7ea1663affac567d
Created Nov 16, 2015
metaslider_fix_agp_font_awesome
View gist:00df7ea1663affac567d
function metaslider_fix_agp_font_awesome() {
if( isset( $_GET['page'] ) && $_GET['page'] == 'metaslider' ) {
wp_dequeue_script("colorbox-js");
wp_dequeue_style("colorbox-css");
}
}
add_action('admin_enqueue_scripts', 'metaslider_fix_agp_font_awesome', 10);
View gist:58b547297623280788d2
function metaslider_fix_beaton() {
if( isset( $_GET['page'] ) && $_GET['page'] == 'metaslider' ) {
wp_dequeue_script("custom-js");
wp_dequeue_script("setup-js");
wp_dequeue_script("upload-js");
wp_dequeue_script("datepicker-js");
}
}
add_action('admin_enqueue_scripts', 'metaslider_fix_beaton', 10);
View Meta Slider Force Vimeo HTTPS
function ms_vimeo_force_https($url, $slider_id, $slide_id) {
return "https:" . $url;
}
add_filter('metaslider_vimeo_params', 'ms_vimeo_force_https', 10, 3);
@tomhemsley
tomhemsley / gist:c05c662af05c5015ce12
Created Jun 11, 2015
Meta Slider - Amazon S3 CloudFront
View gist:c05c662af05c5015ce12
/**
* Use wp_get_attachment_url to retrieve the attachment URL
*
* Important: Resized images created by Meta Slider are not uploaded to s3.
* Important: Disable cropping in the slideshow settings to stop Meta Slider from outputting a URL to a file that doesn't exist on S3.
*/
function metaslider_s3_cloudfront_url($local_url, $attachment_id) {
return wp_get_attachment_url($attachment_id);
}
add_filter('metaslider_attachment_url', 'metaslider_s3_cloudfront_url', 10, 2);
@tomhemsley
tomhemsley / gist:9137a45290cbdbab1557
Created Apr 30, 2015
Meta Slider Tubeplayer Protocol
View gist:9137a45290cbdbab1557
function metaslider_protocol() {
return "https";
}
add_filter('metaslider_tubeplayer_protocol', 'metaslider_protocol');
View gist:94ba5a950635c9bf9c85
/**
* Adds a {comment_count} template tag to Meta Slider Post Feed captions
*/
function metaslider_comment_count($content) {
$content = str_replace( "{comment_count}", comments_number() , $content );
return $content;
}
add_filter( "metaslider_post_feed_template", "metaslider_comment_count" );
@tomhemsley
tomhemsley / gist:e93278442398757eccfc
Created Apr 21, 2015
Meta Slider - Nivo Responsive Caption
View gist:e93278442398757eccfc
@media screen and (max-width: 480px) {
.metaslider .nivo-caption * {
font-size: 0.8em;
}
}
You can’t perform that action at this time.