Home Forums General Issues Hot to build shortcode for returning images in Gallery


Hot to build shortcode for returning images in Gallery

  • 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,

  • Hi,

    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:

    [mygallery image=”1″]
    [mygallery image=”2″]

    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 and you can find many tutorials on creating custom sortcodes.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.