Warning: Attempt to read property "ID" on null in /home/u522501990/domains/readforlearn.com/public_html/wp-includes/media.php on line 2777
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
- current_shortcode() – detect currently used shortcode
- Get shortcode name from within it’s callback function? [duplicate]
- Tinymce – How to hook before or after live shortcodes rendering?
- How to customize a shortcode using the customizer
- Stray closing paragraph tag when using shortcodes
- Customizing gallery shortcode in 3.5
- How can I make all gallery images to open in a new window?
- The result of a shortcode appear BEFORE page content
- Getting the count of a shortcode that is nested
- Get shortcode attributes outside shortcode function
- How can I get the current user email instead of user ID?
- How to put an “include” inside a “do_shortcode”?
- Changing playlist shortcode thumbnail sizes?
- Editing built in Gallery shortcode to filter by categories
- WordPress 4.7 Galery shortcode not working
- How can i remove the paragraph from shortcodes content?
- Easy way to show excerpts of specific posts on a page
- Shortcode content not displaying on Home page
- shortcode causing the_content() to return blank?
- WordPress shortcode display as plain text
- Replace / Remove Shortcode after 1st run / post
- Can I wrap an unordered list inside a shortcode?
- Create own WordPress shortcode gallery
- WordPress shortcode for a section Template
- Shortcode default attributes over-riding non-default attributes
- Add the last viewed post title to a contactform with shortcode [closed]
- Make a Shortcode load after Post/Page Content?
- Adding a template part as part of a shortcode
- Just display content between shortcode brackets
- How to explode single string IF it’s used in shortcode
- Check if CTP category taxonomy is set in shortcode
- Getting Page Content Using Shortcode
- Turning variable into a value set in shortcode
- tax query shortcode
- How can I extract a word from page/post URL using shortcodes
- Shortcode question…. javascript
- Template not loading with get_template_part or locate_template
- Check if parent page has child page of certain slug
- Variable inside shortcode or shortcode inside shortcode
- Remove figcation from excerpt
- Shortcode select another dbbase
- Geoip shortcodes in comments
- Shortcode not interpreted if parameter set
- Create shortcode to display specific post in relationship current date
- Add custom shortcodes to the Welcome Mail
- How to handle multiple nested shortcodes with different tags?
- Using shortcode to stop post content from displaying
- Shortcode Attribute contains clone of all shortcode attributes
- How to echo an array returned by a function
- Creating custom shortcode
- What is short code for following?
- Shortcode not working in custom post types
- Shortcode or placeholder for theme options page?
- How to print [embed] code in wordpress [duplicate]
- IFrame Shortcode plugin – issue
- How to call shortcode on button click
- How can you alter the name of attributes in a shortcode?