Replace ngg shortcode value using a function
-
Hi,
I currently insert galleries into a ACF WYSWYG field using the following shortcode:
[ngg src=”galleries” ids=”202″ display=”basic_thumbnail” images_per_page=”20″]
The gallery is then displayed on a separate page created using WordPress endpoint.
However, I would like to also display the gallery images on the main post page but with less images per page. I already have hundreds of galleries so pasting a new shortcode with a new images_per_page value into a new ACF field ins’t an option.
I have tried a few methods using shortcode_atts and shortcode_atts_{$shortcode} but I can’t seem to get the images_per_page value to change.
Do you know of a realiable way to essentially alter the images_per_page attribute and change it using PHP? I want to be able to set the number of images per page to 6 for every gallery dislayed ont he main post page. And have the original amount displayed on the page created suing the endpoint?
I hope this makes sense adn thanks for your help.
- The topic ‘Replace ngg shortcode value using a function’ is closed to new replies.