You might be missing global $post before the foreach loop in your shortcode function. Please refer to the setup_postdata codex entry.
Related Posts:
- Shortcode to insert
- Shortcode putting html such as
- How to return a string that has a variable inside in a shortcode?
- Using Echo in ShortCode – Stuck
- Passing a shortcode attribute to a sub-function
- Multiple do_shortcode($content) within one shortcode
- Adding Image Count to Multigallery
- My shortcode is showing up twice
- Custom plugin issue when trying to use the shortcode twice on a page [closed]
- WordPress menu deletes when trying to add a hook
- How to find the output of contact form 7 shortcode? [closed]
- How do i get (unique) page name?
- Can A Shortcode Get HTML/Text From Content And Return It Twice With Added HTML?
- Browser title script ignoring is_page /else conditional [closed]
- Nested shortCode functions in the functions.php file
- get_page_by_title with an apostrophe in variable
- Making Quote Plugin more efficient
- How to limit the content coming from wordpress shortcodes?
- How can I get content inside one shortcode to another shortcode?
- is_page “range” for if statement?
- How can I generate random numbers inside my shortcodes on each implementation?
- Use WP_Query in shortcode
- Create shortcodes within foreach loop (using array)
- Different loop output every x posts in custom post type
- Showing a different gallery in a seperate post
- How to exclude category ID from Looper in WordPress
- Add a specific part of current category page url to shortcode
- How to display data from custom table in wordpress phpmyadmin
- Calculating a large number of MYSQL queries as customshort codes, slow
- WordPress Shortcodes.. printf is outputting a random number… Can’t figure out WHY?
- How can I dynamically update the class in my shortcode?
- Creating own shortcode – echoeing php variable based on JS variable
- How create a Shortcode with hover and complex options
- Remove from shortcode
- Displaying recent posts on static page with template-part via shortcode
- How to Reference/Echo Variable from Another PHP Function
- Replace shortcode in substring
- Only first shortcode gets executed
- echo something inside a shortcode
- displaying content that includes shortcodes within an echo
- List taxonomy term slugs within shortcode (do_shortcode)
- Display Data in Table from External Database in WP using Shortcodes
- do_action(), iFrame Gets Displayed Despite Password Protection [closed]
- Using Shortcode to Grab Archive Listing, Separate by Year
- Capitalize Shortcode Value on Output
- Why is my str_replace not working on short code submitted by front-end?
- List all blogs, but exclude the main site
- Shortcode not staying inside div tag
- Shortcode to pull posts
- PHP code inside Shortcode
- Help Fallback (thumbnail)
- How to return a string that has a jQuery and Ajax inside in a shortcode?
- Shortcode function doesnt work without caption
- Action Hook Inside WordPress Plugin Shortcode
- How can I include the user id inside of a shortcode php output?
- PHP Helper Class to create shortcodes
- Create special button on WP Tiny MCE Posts Editor for Shortcodes
- Change Spaces to Dashes?
- Updating Metadata with Shortcode
- using shortcodes inside gravity forms
- How to Create custom block for displaying information in content section which act like shortcode
- Display logged in user name and lastname on page
- Create shortcode for metabox gallery
- Replace background image with post thumbnail in shortcode
- couldnt show short code atts in category
- Conditional formatting on data fetched from MYSQL
- Having trouble creating two shortcodes, one for logged in user and one for visitors
- Advanced Custom Forms PHP formatting for do_shortcode
- overwrite wordpress gallery with custom gallery shortcode
- How to use Contact Form 7 shortcode value in a page?
- Display current user metadata on WordPress page
- Add Shortcode to ::before class
- Reload page with a different shortcode when a user selects from a dropdown
- How Can I Display the Last Modified Date for User Profiles on WordPress?
- Shortcode’s output to use as other shortcode’s parameter
- Show products per shortcode
- Open/closed function [closed]
- What is wrong with this shortcode? to include external php file in WordPress posts
- Need to Echo A Url path to show on a wordpress page
- Add two or multiple functions in WordPress Post or Page
- Shortcode Works for Logged in Users but Not Working for Guest
- perform mathematical operation on shortcode
- Update same content in multiple posts at once?
- Formatting Shortcode to Display in Visual Mode
- problem multisite with blog id
- How to pass parameter that ends up being part of a class name with wordpress shortcode
- Create dynamic content from one WP page to multiple other pages
- Shortcode Display From WordPress Dashboard Page Without Using post_id
- Do_shortcode on PHP file outside theme ALMOST works
- Overwriting a Shortcode
- Custom Shortcode with Dynamic Button
- Whats wrong with my code? Need To add String to shortcode? [closed]
- A next page function with shortcode?
- using a shortcode in a hyperlink
- Shortcode for Visual Composer Grid fails turning string to integer
- Display total count of products in orders of a specific order status
- Gutenberg – render_callback does not pass ToggleControl value on frontend
- HTTP 500 Error after Creating Shortcode
- How call WordPress shortcode inside function file
- How to execute a shortcode within a custom field?