Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Get the featured image URL.
- *
- * @param string|array $size // Name of image size or an array; array( 300, 400 )
- * @param boolean $icon Use a media icon to represent the attachment.
- * @return string|boolean
- * @author Kenth Hagström
- * @version 1.0
- * @license GPL
- */
- function keha76_get_image_url( $size = 'thumbnail', $icon = false ) {
- global $post;
- $src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), $size, $icon );
- if( $src ) {
- echo $src[ 0 ];
- }
- return false;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement