how to show image gallery

WordPress
May 23, 2020 03:37:34
msk285
Topics: 11
Messages: 36
Hello,
How can I upload the whole image gallery into the pdf?
So for example, maybe I have a website selling cars and if I want to sell that car I have to put pictures of the front view, back view, and two other side views. How can I be able to add all the pictures in a pdf? So I will be adding a gallery because the photos will be different for other types of cars.

Thanks :)
May 23, 2020 06:35:48
E2Pdf
Topics: 7
Messages: 3614
Support
Hi,

If gallery will be added to post content it could be used "Preg Match All" filter as example below. It will mark all images inside post by pattern and value can be output via "Preg Match All Output". Keep in mind please that example pattern prepared for default gallery output so it could be need to modify it depending on which HTML code generated for gallery inside page.

"Preg Match All Pattern" - is preg_match_all pattern to map needed elements. (/<figure><img src="(.*?)"/)
"Preg Match All Output" is the path to navigate via array keys (1.0)
"Value" - must be set to [post_content]

Example screenshot attached:
1.0 - 1 is the group number, 0 is the number of element inside group.
1.1 - will output 2nd match in 1st group.
1.2 - will output 3rd match in 1st group and so on...

We remain at your service.

We would really appreciate your feedback at WordPress.org!
May 23, 2020 08:09:15
msk285
Topics: 11
Messages: 36
So I have entered the Preg Match All Pattern, Preg Match All Output and Value however as you can see the image below it's empty. :(

However when I add this to the value, [meta key="_schoolgallery" path="0"], the images look fine as you can see at the bottom photo.
May 23, 2020 08:19:27
E2Pdf
Topics: 7
Messages: 3614
Support
It looks like you have gallery via ACF/Meta Keys. If so then all images data stored in array and solution with "Preg Match All" will not work.

If meta key value works for first image: [meta key="_schoolgallery" path="0"]

Then for 2nd it must be [meta key="_schoolgallery" path="1"], for 3rd [meta key="_schoolgallery" path="2"] and so on. If it will not work, create please "textarea" field with value [meta key="_schoolgallery"] to see which output you will get and share it with us please.

We remain at your service.

We would really appreciate your feedback at WordPress.org!
May 23, 2020 10:21:58
msk285
Topics: 11
Messages: 36
Great!! Thank you!! It works perfectly fine now! I really appreciate your help :)
Get News and Updates
Our monthly newsletter keeps you in the loop, so you'll always be up to date with the latest news and updates about E2Pdf.
* You can update your email subscription preferences here.
All trademarks, service marks, trade names, product names, and logos appearing on this website are the property of their respective owners. The use of trademarks such as Formidable Forms®, Forminator Forms®, Gravity Forms®, JetFormBuilder®, WordPress®, WooCommerce®, WPForms® and others is solely for identification purposes (nominative use) and does not imply any affiliation, sponsorship, or endorsement by the respective trademark holders.
© 2017 - 2026, https://e2pdf.com

We use cookies to collect and analyse information on site performance and usage, to provide social media features and to enhance and customise content and advertisements. By clicking "Accept Selected", you consent to use of selected cookies according to our Cookie Policy.