I don’t know why the code is not working.
But this is how i did this may be helpful for some noob like me
<?php
$name = get_the_content();
preg_match('/\]*)\"]/', $name, $match);
$w3_ids = explode( ",", $match[1] );
$gallery_count=1;
foreach( $w3_ids AS $w3_id ):
$src = wp_get_attachment_image_src($w3_id,'full');
?>
<div class="item <?php if($gallery_count==1)echo "active"; ?>">
<img src="https://wordpress.stackexchange.com/questions/193166/<?php echo $src[0]; ?>" alt="" />
</div>
<?php
$gallery_count++;
endforeach;
?>
Related Posts:
- Check if post/page has gallery?
- how to have the gallery shortcode output one single UL list instead of several DL?
- Automatically add this attribute to the gallery shortcode
- How do i link gallery thumbnails to different url’s using the wp native gallery?
- WordPress gallery ‘post_gallery’ filter doesn’t work with feeds?
- conditional shortcode not working
- Remove width and height attributes from [gallery] output
- Gallery shortcode menu order fix no longer working on WordPress 4.0
- conditional shortcode not working
- Some doubts about gallery shortcode in WordPress
- Should I cache default WordPress gallery shortcode output?
- Numbering Image List in Gallery
- Rewriting WordPress Gallery Shortcode with Bootstrap Carousel
- change wordpress gallery shortcode to slider
- Remove hyperlink on gallery shortcode
- Add custom setting that uses radio button to WP Gallery
- WordPress Gallery shortcode: Display one category ID only
- How to get gallery id inserted to a post?
- Check if post has gallery images/media
- How to Modify WordPress Default Image Gallery Shortcode
- Change WordPress Shortcode added in to post
- Gallery shortcode – change link file image size? (not using default fullsize image)
- add action only if gallery shortcode attribute is equal to?
- Adding shortcode field to edit gallery / Gallery Settings
- How to change the output of gallery shortcode
- Replacement for gallery_shortcode function not taking all attributes
- How to Retrieve data of Gallery Shortcode and display it above a post
- How to copy [gallery] shortcode between posts using polylang [closed]
- Which file renders the “Edit Gallery” Settings page?
- How to display NextGEN gallery in templates?
- Use full size images in a specific gallery
- How to Enable embedding WordPress default gallery in comments?
- How to add new images to existing shortcode configuration?
- Gallery shortcode is empty but magically creates a gallery
- Can we add a single caption to the gallery shortcode?
- Automatically add class-attribute to gallery?
- Replace custom gallery shortcode with default gallery shortcode
- WordPress Gallery with ID’s Shortcode not Working
- Remove width and height attributes from [gallery] output
- Changing layout of defaul gallery output to masonry
- What makes a placeholder resizable in Tinymce?
- how to show last 5 images from the one post gallery
- Gallery Shortcode: using size=”full” doesn’t call the actual thumbnail image size
- Show shortcode without executing it
- How does a shortcode work?
- Run visual composer code in php page
- Remove wptexturize from a shortcode?
- Using shortcode in Post title
- Audio or playlist shortcode condition according to the amount of files on attachment page
- WP_enqueue_script inside shortcode?
- Calling function from within functions.php returns unwanted value
- template_redirect to accompany with a shortcode
- Tinymce shortcodes within shortcode contents
- passing multiple parents value into a shortcode
- Is it possible to add a repeater field to TinyMCE’s option window?
- How do I preview the result of a shortcode in the TinyMCE editor?
- Raw output (preventing wpautop)
- Conditionally loading Facebook PHP SDK in shortcode
- Are shortcode functions applied while rendering the content, or are they executed and stored with the post content?
- is_admin() returns false in save_post hook with Gutenberg editor
- Why are Shortcodes Disabled in Widgets by Default?
- possibility to control embedded video timeline with buttons and links external to the player
- WordPress Shortcode show database row
- Gallery IDS and Captions: hide/show on a per ID basis
- Shortcodes won’t work on live environment
- Adding option to Gallery shortcode
- Shortcode: text content ends up outside html tags
- Basic do shortcodes question
- What is this format called (nested shortcodes)?
- Problem with height in video shortcode
- Best tools for preparing and styling a table [closed]
- How can I insert a shortcode in the title tag of another?
- Shortcode inside text widget do not call enqueue style
- Metabox Keeps Stripping Parts of Shortcode
- Checking post content for a shortcode, but content is being returned as empty
- do_shortcode() won’t return PHP Array
- Show shortcode only in posts
- get_queried_object_id / short code returning blank
- Shortcode won’t take into account custom post ID put in parameter
- shortcode to display specific recent posts
- How to test If a post has a particular term
- wp_link_pages shortcode for ‘nextpagelink’
- Multiple values for one variable
- Function in a wordpress shortcode
- Impossible to display modification in shortcode code?
- Use Shortcode on Custom Page
- WordPress Database Error using $wpdb->get_results()
- Shortcode or Template Page
- Ajax callback and shortcode functionality
- Duplicate short code duplicating some values only
- Shortcode for External HTML
- How to implement theme shortcodes in text outside of pages?
- Loading shortcode stylesheet only when shortcode is in text widget [closed]
- Shortcode with multiple variables
- Can’t get default values to work with custom shortcode
- How create a shortcode with html
- Adding shortcode [closed]
- do_shortcode autommatic content generation
- Using $variable in shortcode
- shortcode causes broken paragraph tags