I had to set the post type in the query.
'post_type' => 'gallery'
Problem solved!
Related Posts:
- How navigation works in custom loop within shortcode?
- Do not show child pages of child pages
- How to explode single string IF it’s used in shortcode
- Check if CTP category taxonomy is set in shortcode
- Query posts only with actual text content (not including shortcode or images)
- Global $post returns 2 objects for my shortcode
- Check if parent page has child page of certain slug
- SQL query to bulk change short code in all posts
- Running Filter or Shortcode Before Query Prevents Excerpt from Showing
- Modify Blog Module layout in Child theme
- Display title of child pages in shortcode
- Why does my shortcode query not working with search term
- Conditionally Loading JavaScript/CSS for Shortcodes
- shortcodes output before content [duplicate]
- WordPress adds br in between my shortcode
- Problem with ‘post__not_in’
- Shortcodes, HTML tables, and multiple rows
- Shortcode to Gutenberg-block: additional text on front-end and conditional display
- pagination in author.php template returns 404 error
- Use [shortcode=”value”] instead of [shortcode att=”value”]?
- I dont want to show shortcode in tag
- Post loop created via shortcode not displaying shortcode in content
- Pass shortcode variables to template
- How to Loop within a Loop (Display Children and then Grandchildren)
- Shortcodes: Pros and Cons
- esc_attr not working in shortcode
- Can’t understand $atts in functions?
- Are .MP3 files with capital letter extensions allowed in [audio] shortcode?
- How to parse this shortcode?
- Get Posts shortcode plugin and meta_query?
- Shortcode parsed incorrectly because of heredoc
- Shortcode is running in page editor
- How to get all child pages in their parent page?
- Creating shortcode with parameter
- Video Shortcodes not working in WordPress
- Custom shortcode is not working in text widget
- Create shortcode in Child Theme?
- Get post object in shortcode function
- How to insert image and text from admin panel throughout my theme
- Use shortcodes in terms description? [closed]
- Adding to the_content or a variable from within a shortcode function
- How to add shortcode to HTML file (not showing on website)
- Custom Shortcode: define cursor position/insertion point?
- How to display posts by vote count and if no value continue with latest posts with no votes?
- show shortcodes in editor
- Image Shortcode from ACF ID
- Page code showing in WP Dashboard
- echo do_shortcode just prints the shortcode name and not its content
- How to create a shortcode with html and php code
- Insert shortcode between ”
- Create a shortcode to use in visual editor
- Custom youtube shortcode that uses $content
- How to build dynamic pages?
- Shortcode not showing $content in correct place
- How to reload the shortcode content when the database is changing
- Best way to include reusable sections in page content
- Custom shortcode to display posts, first post is full
- How to give classname to post if post has no content?
- How to add data attributes to the wordpress audio shortcode
- Pass fileurl parameter into shortcode from Advanced Custom Fields
- stop WordPress removing shortcode from content [closed]
- caption shortcode using image alt as caption
- Sanitize or treatment of string in editor via shortcode
- Is it possible to handle two or more shortcodes in a single page?
- Toggle Shortcode Sanitize Title
- Execute Shortcodes when submitting post
- Substituting value via shortcode
- Can’t render shortcode when html tag contains hyphen
- Shortcode to appear and show the date not code in Title and description of Social Media sites
- Not to escape a text
- how to add shortcode widget at end of main blog page
- Shortcode result appears above page content
- Pagination for custom posts loop
- Shortcode is not showing content when placed in editor (post_type = page)
- How to insert a short code into Contact Form 7 in WordPress that will call a function once the submit button is pressed
- How to Call Related Post based on Categories Inside Post Content with Shortcode?
- Offset with ajax load more posts duplicates
- Multiple shortcodes only use attributes from one of the shortcodes on custom plugin
- Cannot modify class property from shortcode handler function
- Reusable Dynamic Taxonomy Shortcode
- How do i remove Business feeds Shortcode fatal error
- Can’t place endwhile in the loop properly in a shortcode
- How to reduce the image size inside an icon? [closed]
- How to insert visual compser post grid shortcode in a custom page template? [closed]
- latest posts shortcode with image
- Shortcode tags appear on mobile themes
- Ordering posts alphabetically by meta keys and title
- Why I have this strange behavior when I try to exlude the featured post from posts visualization?
- Video shortcode inside tabs shorcode NOT working
- Manipulated shortcode output
- Where is escaped the shortcode?
- Str_replace using shortcode with multiple changes
- Changing layout of defaul gallery output to masonry
- WordPress do_shortcode first iteration
- Add widget/shortcode to sidebar OUTSIDE of the theme
- How to remove https:// from shortcode generated url
- How to enable on custom shortcodes
- Nested ShortCode works inside the_content, but not outside of it
- I have the query code but not the shortcode
- wordpress how to sort posts on custom data with plug-in “Search & Filter”