If you want to display the attached image gallery, from another post, you can use:
where the custom id attribute is the post ID.
If you want limit the number of items in a gallery, there seems to be a plugin available on wordpress.org called Limit parameter for gallery shortcode (no affiliation). It uses the pre_get_posts filter to change the posts_per_page and offset attributes of the get_posts() or get_children() calls in the gallery shortcode callback.
Example:
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
- 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?
- Unable to the get the gallery inserted between shortcodes
- 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
- Using get_option() in JavaScript
- Shortcode empty attribute
- How to display the site name in a WordPress page, or post
- How can I put a wp_redirect into a shortcode?
- Using audio shortcode for .mp3 URLs with a query string
- Why do_shortcode is not executing the shortcode in data-* html attributes?
- Adding Image Count to Multigallery
- Prevent add_shortcode from escaping a tag
- Remove HTML content if attribute is not set / variable attributes
- Legacy Audio Shortcode
- Extending the Audio Shortcode
- How resource intensive is wp_register_script()?
- Convert shortcode into html form [closed]
- Register visits of my pages in wordpresss
- List monthy archives for specific year with wp_get_archives
- How can I included CSS to a page or a shortcode? [closed]
- Call Shortcode inside another Shortcodes callback
- Creating a shortcode in a plugin that includes JS
- Shortcode to delete post from front end
- How to parse shortcodes within returned content
- Hook WP_Embed run_shortcode
- Shortcodes attributes defaults
- Get Required Assets (JS, CSS etc) for post using REST API
- shortcode in snippet plugin not work
- AJAX and Shortcode with Parameters
- How to protect parts of my code from TinyMCE modification when switching from text to visual mode?
- Responsive Embeds using default embed shortcode
- Gallery shortcode numerical sorting
- Custom shortcode breaks my page
- Shortcode is not working
- Custom shortcode is causing a WSOD
- Get attributes of nested shortcodes
- How to create a shortcode to let the user add the ID of a YouTube video?
- How to add shortcode to html widget
- Add div on EMED Tag
- Clean way of using ob_start() and ob_end_clean() in wordpress
- Theme Convert PHP code to shortcode
- Processing a login/register form before shortcodes are rendered?
- Adding a cover image to video shortcode
- Insert First Image into post (full-width)
- How to display html element and php string in the same line?
- Restricting shortcode for users
- Shortcode, vs blocks, vs templates – what would you do for choosing or creating custom post data in editor?
- create shortcode that changes url endpoint
- Convert WordPress shortcodes into plain html
- Attributes are not passed on nested shortcode
- How to make a shortcode with a line break in it parse correctly?
- Removing text + shortcode from all posts
- Access the resized images generated by `add_image_size()`
- Class variables in shortcodes
- Defining the output of a WordPress Att
- Custom WP theme not showing shortcodes
- Shortcode for sectors
- A number appears inside a div called wpb_wrapper, when I use a custom shortcode
- Enclose article’s body with default shortcode
- Shortcode with foreach
- Trying to create a shortcode that displays taxonomy terms in a dropdown