Skip to main content
deleted 51 characters in body
Source Link
Wyck
  • 18k
  • 4
  • 46
  • 67

That's not going to work, instead just use wp_get_attachment_image_src , it takes a size parameter.

// get the $attachment_id
$attach_stuff = wp_get_attachment_image_src( $attachment_id, 'full');
var_dump($attach_stuff);

You will be returned an array fo values to work with:

[0] => url
[1] => width
[2] => height
[3] => boolean: true if $url is a resized image, false if it is the original.

I am using var_dump in my example because you need toAlso turn on debugging.

That's not going to work, instead just use wp_get_attachment_image_src , it takes a size parameter.

// get the $attachment_id
$attach_stuff = wp_get_attachment_image_src( $attachment_id, 'full');
var_dump($attach_stuff);

You will be returned an array fo values to work with:

[0] => url
[1] => width
[2] => height
[3] => boolean: true if $url is a resized image, false if it is the original.

I am using var_dump in my example because you need to turn on debugging.

That's not going to work, instead just use wp_get_attachment_image_src , it takes a size parameter.

// get the $attachment_id
$attach_stuff = wp_get_attachment_image_src( $attachment_id, 'full');
var_dump($attach_stuff);

You will be returned an array fo values to work with:

[0] => url
[1] => width
[2] => height
[3] => boolean: true if $url is a resized image, false if it is the original.

Also turn on debugging.

Source Link
Wyck
  • 18k
  • 4
  • 46
  • 67

That's not going to work, instead just use wp_get_attachment_image_src , it takes a size parameter.

// get the $attachment_id
$attach_stuff = wp_get_attachment_image_src( $attachment_id, 'full');
var_dump($attach_stuff);

You will be returned an array fo values to work with:

[0] => url
[1] => width
[2] => height
[3] => boolean: true if $url is a resized image, false if it is the original.

I am using var_dump in my example because you need to turn on debugging.