Getting rid of default grey image thumbnail in Gimliii theme

Well , many people asked me , how to get rid of default thumbnail image if we set the home page to show blog posts.

It’s simple , we create a child theme and change copy the whole home.php file from parent theme into child theme and go to lines 16-19 where it has:

[php]<div class="col-md-5">
<?php if ( has_post_thumbnail() && ! post_password_required() ){ ?>
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail(‘thumb-medium’);
echo "</a>";
}else{
?>

<img src="<?php echo get_template_directory_uri(); ?>/img/default-thumb.jpg" alt="<?php the_title(); ?>" class="img-responsive"/>
<?php
}?>

</div>
<div class="col-md-7">

[/php]

1) If you want to completely don’t want to use thumbnails , replace the above lines with the following:

[php]
<div class="col-md-12">
[/php]

This is the child theme for the above one.Download here.

2) If you want to use featured images for some posts and for others not.

Use the following child theme.Download here.

3) If you want to use another image , just replace the “default-thumb.jpg ” and “default-thumb-small.png” images in the images folder of your  theme .Don’t forget to use same image names and formats.

How to Get the Post Thumbnail URL in WordPress

Some people recently asked us how to get the post thumbnail URL in WordPress. The goal here is to just get the post thumbnail URL and then use it with their own markup. In this article, we will show you how to get the post thumbnail URL in WordPress.

Simply paste this code inside the loop code that you are writing.

<?php

$thumb_id = get_post_thumbnail_id();
$thumb_url = wp_get_attachment_image_src($thumb_id,'thumbnail-size', true);
echo $thumb_url[0];
?>
 Continue reading How to Get the Post Thumbnail URL in WordPress