Skip to content

Instantly share code, notes, and snippets.

@warrendholmes
Created August 15, 2012 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save warrendholmes/3360943 to your computer and use it in GitHub Desktop.
Save warrendholmes/3360943 to your computer and use it in GitHub Desktop.
Get featured image directory path
$wp_upload_dir = wp_upload_dir();
$wp_upload_dir_basedir = $wp_upload_dir['basedir'];
$thumbnail = get_post_meta( get_post_thumbnail_id( $post_id ) , '_wp_attached_file', true );
$thumbnail_path = trailingslashit( $wp_upload_dir_basedir ) . $thumbnail;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment