Get post attachment images dimension and use in embed code
WordPress has a predefined function, wp_get_attachment_image_src that returns the following information as an array: [0] => url [1] => width [2] => height But, the function requires that you know the attachment’s ID, not the post’s ID. In order to get that, you’ll need to use get_post_thumbnail_id. Here’s the two functions together in action: $image_id … Read more