I would like to build a shortcode for returning images in gallery, if this doesn’t exist already (not sure).
For example my authors will write [myimages number=”1″] to display the first image in the gallery and so on..
Could anyone help with this please?
many thanks in advance,
I couldn’t find anything on this but it should be quite simple.
In each post, I am adding all the images in the gallery field.
Now I would like my authors to be able to insert each image between text using a shortcode like this:
Any help would be much appreciated!
Creating a custom shortcode is not really an ACF subject, even if you’re using an ACF field to do it, which is why you’re not going to find any information on it on the ACF site or in any of the documentation.
This WP page has most of the information you’ll need on creating shortcodes https://codex.wordpress.org/Function_Reference/add_shortcode and you can find many tutorials on creating custom sortcodes.