Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

get_post_gallery_images only returns a singular array of image URLs, so $image->post_title etc won't work, hence your error message.

The approach generally is off - you've followed the codex for get_post_gallery_images but that snippet is aimed at re-using the image urls within the post, but outside the gallery output.

get_attached_media is more suited here (just a more concise helper than writing $args out for a get-posts call). http://codex.wordpress.org/Function_Reference/get_attached_media

If this is a modification to all your galleries then the answer below will show you a much better and more flexible approach (using the post_gallery filter instead). http://stackoverflow.com/questions/19802157/change-wordpress-default-gallery-outputhttps://stackoverflow.com/questions/19802157/change-wordpress-default-gallery-output

get_post_gallery_images only returns a singular array of image URLs, so $image->post_title etc won't work, hence your error message.

The approach generally is off - you've followed the codex for get_post_gallery_images but that snippet is aimed at re-using the image urls within the post, but outside the gallery output.

get_attached_media is more suited here (just a more concise helper than writing $args out for a get-posts call). http://codex.wordpress.org/Function_Reference/get_attached_media

If this is a modification to all your galleries then the answer below will show you a much better and more flexible approach (using the post_gallery filter instead). http://stackoverflow.com/questions/19802157/change-wordpress-default-gallery-output

get_post_gallery_images only returns a singular array of image URLs, so $image->post_title etc won't work, hence your error message.

The approach generally is off - you've followed the codex for get_post_gallery_images but that snippet is aimed at re-using the image urls within the post, but outside the gallery output.

get_attached_media is more suited here (just a more concise helper than writing $args out for a get-posts call). http://codex.wordpress.org/Function_Reference/get_attached_media

If this is a modification to all your galleries then the answer below will show you a much better and more flexible approach (using the post_gallery filter instead). https://stackoverflow.com/questions/19802157/change-wordpress-default-gallery-output

Source Link

get_post_gallery_images only returns a singular array of image URLs, so $image->post_title etc won't work, hence your error message.

The approach generally is off - you've followed the codex for get_post_gallery_images but that snippet is aimed at re-using the image urls within the post, but outside the gallery output.

get_attached_media is more suited here (just a more concise helper than writing $args out for a get-posts call). http://codex.wordpress.org/Function_Reference/get_attached_media

If this is a modification to all your galleries then the answer below will show you a much better and more flexible approach (using the post_gallery filter instead). http://stackoverflow.com/questions/19802157/change-wordpress-default-gallery-output