How to use Shortcode
-
Hi there,
I’m confusing myself but I just can’t get the shortcode to work.
I have a flexible field containing a Gallery group named image_gallery containing three fields called gallery_title [text], gallery_desc [text area] & gallery_big [gallery with 10 images].
What shortcode do I use in the php file please?
The code I have just returns the five oldest images not the ones in the gallery:<?php // check current row layout ?> <?php if( get_row_layout() == 'image_gallery' ): ?> <section> <?php $image_ids = get_sub_field('image_gallery', false, false); $shortcode = '[' . 'gallery ids="image_gallery' . implode(',', $image_ids) . '"]'; echo do_shortcode( $shortcode ); ?> </section> <?php endif; ?>
The page I need help with: [log in to see the link]
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘How to use Shortcode’ is closed to new replies.