Skip to content

Load images on your WordPress site after the page finishes loading. Inspired by Medium's approach.

Notifications You must be signed in to change notification settings

kashishkumawat/wordpress-progressive-images

 
 

Repository files navigation

Progressive images for WordPress

This is a WordPress 🔌 plugin that loads your post thumbnail after your page loads.

Requirements

PHP > 5.3, since we use namespacing.

To install

  • Download repo
  • Move file to your wp-content/plugins directory
  • Activate plugin via wp-cli or the WordPress dashboard

Issue reporting

I built this plugin for the 2017 Orange County WordCamp plugin contest, so I won't be actively maintaining this project.

Available filters

Remove functionality on ALL post thumbnails:

add_filter( 'Progressive_Images\enabled', function( $post_thumbnail_id ) {
    return false;
}, 10, 1 );

Remove functionality on a specific post thumbnail:

add_filter( 'Progressive_Images\enabled', function( $post_thumbnail_id ) {
    if ( 1234 !== $post_thumbnail_id ) {
        return true;
    }
    return false;
}, 10, 1 );

Add a class to the wrapping markup on post_thumbnails

add_filter( 'Progressive_Images\markup_wrapper_class', function( $class ) {
	$class .= ' your-awesome-class';
	return $class;
}, 10, 3);

About

Load images on your WordPress site after the page finishes loading. Inspired by Medium's approach.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 64.9%
  • JavaScript 29.0%
  • CSS 6.1%