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
- How to create a shortcode with 1 parameter (atts)
- WordPress adds br in between my shortcode
- WP_enqueue_script inside shortcode?
- Ajax, filters and shortcodes
- Shortcode to Gutenberg-block: additional text on front-end and conditional display
- WordPress shortcode doesn’t working on HomePage
- Add attribute to shortcode dynamically
- Execute shortcode twice in the same page
- How to parse this shortcode?
- Shortcode with hyphen doesn’t work
- Shortcode parsed incorrectly because of heredoc
- Shortcode “post_per_page” not working
- Shortcode is running in page editor
- Creating shortcode with parameter
- Shortcodes won’t work on live environment
- Create shortcode in Child Theme?
- Create a short code to display a specific loop
- How to add shortcode to HTML file (not showing on website)
- Adding javascript actions to words in post content
- My shortcode does not call the function
- Hide Selection of Text From Archive, but Show on Single Posts
- How to create an incremental list using shortcodes?
- Do shortcode that is inserted in a textarea is not displaying properly
- Adding custom form within add_shortcode
- wp_editor not rendering the shortcode
- how to add shortcode in wordpress container [duplicate]
- How to make this shortcode work for post content wordpress [duplicate]
- stop WordPress removing shortcode from content [closed]
- Is it possible to handle two or more shortcodes in a single page?
- Toggle Shortcode Sanitize Title
- Clearfix Shortcode
- How and when to include shortcode source files
- how to create a fav icon shortcode?
- How to deal with WordPress bug: can’t use wrapped and unwrapped shortcode on same post
- Execute Shortcodes when submitting post
- Substituting value via shortcode
- Create shortcode for each form field in contact form 7
- Auto embeds don’t work for attachment descriptions
- Shortcode to appear and show the date not code in Title and description of Social Media sites
- how to add shortcode widget at end of main blog page
- Shortcode is not showing content when placed in editor (post_type = page)
- How to set up posts per page on WP
- How to insert a short code into Contact Form 7 in WordPress that will call a function once the submit button is pressed
- Unable to make shortcode, what is wrong?
- How do i remove Business feeds Shortcode fatal error
- Push Shortcode parameter to template
- latest posts shortcode with image
- Featured image with link to post shortcode, image displaying above the post
- Video shortcode inside tabs shorcode NOT working
- How to stop unwanted splits in excerpts when using shortcodes for sliders or players
- How to add meta slider lite or other slider to main page header in pinboard theme
- Escaping a shortcode so it displays as-is [duplicate]
- WordPress do_shortcode first iteration
- Add a short code to a plugin
- Applying if (get_post_meta) to new shortcode
- Add widget/shortcode to sidebar OUTSIDE of the theme
- How to remove https:// from shortcode generated url