Site icon Hip-Hop Website Design and Development

Get a different size of Image thumbnail while working with custom metabox

I am using custom metabox for a page in my new project, I am using it for uploading image, and attaching it to the page. It’s working fine, I can select image or upload the image using WordPress’ native uploader, and attach it. The issue is that I am getting the large size image only.

What happens is I have to resize it by specifying its width and height. Is there any way to get the other sizes of the uploaded or selected images via WordPress native uploader.

I know I can get the thumbnails by using wp_get_attachment_image_src function, but in order to work with this function I have to get attachment_id, I don’t have it.

What I have is only image url. I don’t know whether I am missing it somewhere or not.