Add custom version to an image

so you can do that in 2 different ways 1. modify directly on template-parts/content-single.php 2. you can plug it using the add_action(pre_get_post,func_with_your_staff ) inside this function func_with_your_staff( $query ) { global $wp ; if ( $query->is_single() && empty($query->post_type) $query->set(‘post_type’, ‘wherever_is_type’); // perhaps you have a custom_post_type ?> and then you can add your extra staff … Read more

Assign custom class to post content images

As you are using bootstrap you can add img-fluid helper class to images like this. function example_add_img_class( $class ) { return $class . ‘ img-fluid’; } add_filter( ‘get_image_tag_class’, ‘example_add_img_class’ ); get_image_tag_class filter allows to add custom css class along side WordPress default classes. Read more about the filter here

WordPress: Preload next post images

This is what cam of the other piece of code – BIG thank you to @Ivan Ivanic <?php $next_post = get_adjacent_post(false, ”, false );// set last param to true if you want post that is chronologically previous //for debug if(!empty($next_post)){ echo ‘Next post title is: ‘.$next_post->post_title; } else { echo ‘global $post is not set … Read more