Skip to content

Instantly share code, notes, and snippets.

@zitrusblau
zitrusblau / fitvids-lazysizes.html
Last active August 26, 2020 05:24
Make fitVids work with lazySizes
<div class="fluid-embed">
<iframe frameborder="0" allow="autoplay; encrypted-media" allowfullscreen="" class="lazyload" data-src="https://www.youtube.com/embed/4rfnJPhgd9E?feature=oembed"></iframe>
</div>
@zitrusblau
zitrusblau / lazy-load-responsive-images.php
Created May 23, 2017 08:51
Make Lazy Loading Responsive Images Plugin work with AJAX requests (https://wordpress.org/plugins/lazy-loading-responsive-images/)
<?php
defined('ABSPATH') or die("Nothing to see!");
/*
Plugin Name: Lazy Loading Responsive Images
Plugin URI: https://florianbrinkmann.de/1122/responsive-images-und-lazy-loading-in-wordpress/
Description: Lazy loading Images plugin that works with responsive images introduced in Wordpress 4.4.
Version: 3.0
Author: Florian Brinkmann, MarcDK
Author URI: http://www.marc.tv
License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
@zitrusblau
zitrusblau / searchwp_acf_test.php
Created October 20, 2015 13:23
workaround possible searchwp + ACF conflict on 'restrict_manage_posts' filter hook
add_action('init', function() { // workaround to get correct field_object for regions filter, if searchwp admin search is enabled
$regions_field = get_field_object('field_552bd08a5e8bf', false, array('load_value' => false));
// add filter by region for member data
add_action( 'restrict_manage_posts', function () use($regions_field) {
global $pagenow, $current_screen, $typenow;
if ( $pagenow != 'edit.php' OR $current_screen->post_type != 'mitglieder' OR $typenow != 'mitglieder' )
return;