Hello Lisa,
the plugin automatically works for normal WordPress posts/pages.
You seem to have used a very sophisticated portfolio theme and/or plugin? You’d have to edit your theme to use a custom filter wherever you want to display a placeholder. Here is an example for post thumbnails:
$image = get_the_post_thumbnail( $post_id );
$image = apply_filters( 'dominant_colors', $image, get_post_thumbnail_id ( $post_id ) );
echo $image;
This is explained in the FAQ section of my plugin.
Also I do think your theme/plugin has its own lazy-loading technique, which is why the images are faded in. Two lazy-loading solutions are bound to clash, unfortunately.
On a technical level the problem seems to be that your theme (or portfolio solution) is apparently stripping the default wp-image-1234 classes from your HTML. Therefore the Dominant Colors Lazy Loading plugin simply can’t find the images in your pages. It uses those classes to get the IDs of images, which are then used to read the correct colors from the database.
I’m afraid you can’t use my plugin in combination with your portfolio theme without some modifications, sorry!
-
This reply was modified 8 years, 1 month ago by
manuelwieser.
Thread Starter
weilis
(@weilis)
Hello Manuel,
thanks for your answer and detailed analysis of the problem. I think fixing this issue might be beyond my developing skills. So unfortunately there will be no Dominant Colors Lazy Loading for me.
Yours, Lisa