Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- remove_action( 'propertyhive_before_search_results_loop_item_title', 'propertyhive_template_loop_property_thumbnail', 10 ); // remove default functionality
- add_action( 'propertyhive_before_search_results_loop_item_title', 'propertyhive_template_loop_property_thumbnail_lazy', 10 ); // add bespoke functionality
- function propertyhive_template_loop_property_thumbnail_lazy()
- {
- global $post, $property;
- $photo_url = $property->get_main_photo_src( 'large' );
- echo '<img data-src="' . $photo_url . '" alt="' . get_the_title($post->ID) . '" class="lazy">';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement