Infinite Scroll and Image Hover plugin don't r

2019-07-27 09:48发布

After incredibly much effort I finally made infinite scroll (via the plugin) work with my theme. Now I got this little riddle for you sherlocks and watsons, which I hope you can solve:

Infinite scroll works, but on the pages infinite scroll adds when scrolling down, my image hover plugin doesn't appear anymore. (and image hover is quite important to my site!!)

When using your browser's dev tools, you will see, that at least the class wp.imagehoverlite is applied to the freshly loaded images, which is probably a good sign.

Still- no social hover buttons... Link to my Website

In infinite scroll plugin's settings then I discovered this box called callback:

Screenshotenter image description here

That's a hot lead !

I did my research and found this page which explains it's function.

"Since Infinite Scroll dynamically adds new content to the page, sometimes you have to execute additional code to reinitialize those plugins."

This is how I add the hovering effect inside the wordpress loop:

                 <div class="gridly-image">

            <img class="wpimagehover alignnone wp-image-<?php echo get_post_thumbnail_id() ?>" src="<?php echo $image_attributes[0]; ?>" alt="" width="300" height="250" data-fburl="<?php the_permalink() ?>" data-tweeturl="<?php the_permalink() ?>" data-pinurl="<?php the_permalink() ?>" data-stumbleuponurl="<?php the_permalink() ?>" data-sstyle="circle" data-sharetxt="<?php echo get_the_excerpt(); ?>" data-animation="fade" /> 

            </div>

Now we just need to find out, what the heck I need to enter in this big box. OR - find a way to get social buttons on image hover without the plugin.

I really really really appreciate your help. :)

0条回答
登录 后发表回答