Advertisement
niammuddin

post_thumbnail Wordpress

Jul 27th, 2017
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.29 KB | None | 0 0
  1. <?php
  2. $tags = get_the_tags();
  3. foreach ( $tags as $tag ){
  4. $tage = $tag->slug;
  5. }
  6. if ( has_post_thumbnail() ) {
  7. the_post_thumbnail();
  8. }
  9. else { ?>
  10.  
  11. <?php
  12. echo '<img src="' . get_bloginfo( 'stylesheet_directory' ).'/images/no-image-single.jpeg" alt="'.get_the_title().'" />';
  13. ?>
  14.  
  15. <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement