Viewing 1 replies (of 1 total)
  • Thread Starter hxh90

    (@hxh90)

    I found how to do it, thanks to helgatheviking from Stackexchange.

    /**
     * Check if get the image has image
     * @return boolean
     */
    function neutro_has_get_the_image(){
    	if ( current_theme_supports( 'get-the-image' ) ){
    		// Don't print the image
    		$image = get_the_image(array('echo'=>false) );
    
    		if(!empty ($image) ){
    			return true;
    		}
    		else{
    			return false;
    		}
    	}
    }
Viewing 1 replies (of 1 total)
  • The topic ‘How to determine get the image has image?’ is closed to new replies.