public function featuredImageURL($width = null, $height = null, $defaultFeaturedImageURL = '', array $options = [])
    {
        $imageURL = null;
        if ($this->hasFeaturedImage()) {
            if (!$width && !$height) {
                $imageURL = url($this->featuredImage->url) . "?" . strtotime($this->updated_at);
            } else {
                $imageURL = $this->featuredImage->thumb($width, $height, $this->featuredImage, $options);
            }
        }

        if ($imageURL) {
            return $imageURL;
        }
        else if(!$imageURL && $defaultFeaturedImageURL) {
            // return default image if not image is found
            return $defaultFeaturedImageURL;
        }

        return null;
    }
public function featuredImageURL($width = null, $height = null, $defaultFeaturedImageURL = '', array $options = [])
    {
        $imageURL = null;
        if ($this->hasFeaturedImage()) {
            if (!$width && !$height) {
                $imageURL = url($this->featuredImage->url) . "?" . strtotime($this->updated_at);
            } else {
                $imageURL = $this->featuredImage->thumb($width, $height, $this->featuredImage, $options);
            }
        }

        if ($imageURL) {
            return $imageURL;
        }
        else if(!$imageURL && $defaultFeaturedImageURL) {
            // return default image if not image is found
            return $defaultFeaturedImageURL;
        }

        return null;
    }
public function featuredImageURL ( $ width = null , $ height = null , $ defaultFeaturedImageURL = '' , array $ options = [ ] ) { $ imageURL = null ; if ( $ this -> hasFeaturedImage ( ) ) { if ( ! $ width && ! $ height ) { $ imageURL = url ( $ this -> featuredImage -> url ) . "?" . strtotime ( $ this -> updated_at ) ; } else { $ imageURL = $ this -> featuredImage -> thumb ( $ width , $ height , $ this -> featuredImage , $ options ) ; } } if ( $ imageURL ) { return $ imageURL ; } else if ( ! $ imageURL && $ defaultFeaturedImageURL ) { // return default image if not image is found return $ defaultFeaturedImageURL ; } return null ; }
Get URL of post's featured image.

@param int    $width
@param int    $height
@param string $defaultFeaturedImageURL The url of an image that should be returned if no featured image is found
@param array  $options

@return string|null Returns url of featured image if found, null instead
Get URL of post s featured image .