Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save calliaweb/516a5372e958f160d17e to your computer and use it in GitHub Desktop.
Save calliaweb/516a5372e958f160d17e to your computer and use it in GitHub Desktop.
Display Advanced Custom Fields Gallery as an Envira Gallery
@stygmate
Copy link

I would check that the link line is correct. Is it setting the same image url for all the thumbnails?
I use a acf image gallery and enumerate image this way.

			foreach ( $image_ids as $image_id ) {
				$newdata["gallery"][ ( $image_id["id"] ) ]["status"] = 'active';
				$newdata["gallery"][ ( $image_id["id"] ) ]["src"]    = $image_id["url"];
				$newdata["gallery"][ ( $image_id["id"] ) ]["title"]  = $image_id["title"];
				$newdata["gallery"][ ( $image_id["id"] ) ]["link"]   = $image_id["url"];
				$newdata["gallery"][ ( $image_id["id"] ) ]["alt"]    = $image_id["alt"];
				$newdata["gallery"][ ( $image_id["id"] ) ]["thumb"]  = $image_id["sizes"]["thumbnail"];
			}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment