Advertisement
Melkren

php wordpress shiz

Feb 22nd, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. <?php
  2.  
  3. $args = array('numberposts' => 5);
  4.  
  5. $posts2 = get_posts( $args );
  6.  
  7. foreach ( $posts2 as $_post ) {
  8. if ( has_post_thumbnail( $_post->ID ) ) {
  9. echo '<div>';
  10. echo '<img u="image" src2="' . get_the_post_thumbnail( $_post->ID, 'full') . '">' ;
  11. echo '</div>';
  12. }
  13. }?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement