Pulling In A Specific Image with wp_get_attachment_image()
-
Hi,
I’m trying to pull in a specific image from the media library onto a page and I’m using the
wp_get_attachment_image()
function, but it doesn’t seem to be working.The image I wish to use has an id of 142, so in the function I’ve done the following:
src="<?php wp_get_attachment_image( 142, 'large', false, [] );?>"
Am I doing this correctly by just adding the ID number in as the 1st parameter? The examples in the docs aren’t particularly informative. I can’t work out why it isn’t working.
Any help would be really appreciated.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Pulling In A Specific Image with wp_get_attachment_image()’ is closed to new replies.