Advertisement
shakil97bd

Add default featured image in your blog post

Feb 24th, 2015
440
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. ***********************************Add default featured image in your blog post *****************************
  2.  
  3. //Just Paste this code where you want to add featured image.....
  4.  
  5. <?php if ( has_post_thumbnail() ) {
  6. the_post_thumbnail('post_FEATURED_image', array('class' => 'img-responsive'));
  7. }
  8. else {
  9. ?>
  10. <img src="<?php bloginfo('template_directory'); ?>/img/default_img.jpg" />
  11. <?php
  12. }
  13. ?>
  14.  
  15.  
  16.  
  17. NOTE : In this code......
  18.  
  19. post_FEATURED_image = for image crop id
  20. 'class' => 'img-responsive' = this for image class.
  21.  
  22.  
  23.  
  24. ***************************************************** THANK YOU ***************************************************************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement