Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. $out .= '<div class="omsc-recent-posts-title"><h3><a href="'. get_permalink() .'">'. get_the_title() .'</a></h3></div>';
  2.  
  3. if( $thumbnail && has_post_thumbnail() ) {
  4.  
  5. $img = wp_get_attachment_image_src( get_post_thumbnail_id(), apply_filters('omsc_sc_recent_posts_img_size', 'medium'));
  6. if($img) {
  7. $img_html=apply_filters('omsc_sc_recent_posts_img', '<a href="'. get_permalink() .'"><img src="'.$img[0].'" alt="'.esc_attr($post->post_title).'" /></a>', array(
  8. 'img_src' => $img[0],
  9. 'link' => get_permalink(),
  10. 'alt' => $post->post_title,
  11. ));
  12. $out.='<div class="omsc-recent-posts-thumb">'.$img_html.'</a></div>';
  13. }
  14. }
  15.  
  16. $img = wp_get_attachment_image_src( get_post_thumbnail_id(), apply_filters('omsc_sc_recent_posts_img_size', 'medium'));
  17.  
  18. if ( function_exists( 'add_image_size' ) ) {
  19. add_image_size( 'custom-recpost-thumb', 222, 221,true );
  20. }
  21.  
  22. $img = wp_get_attachment_image_src( get_post_thumbnail_id(), apply_filters('omsc_sc_recent_posts_img_size', 'custom-recpost-thumb'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement