Use get_the_ID() instead of $post->ID
This will fix your problem
Related Posts:
- Create a shortcode to display custom post types with a specific taxonomy
- Display custom post type with shortcode
- Add Content to Page without shortcodes
- How can I fix those issues generated by the Themecheck plugin
- Shortcode Displaying Custom Post Types
- Custom Select Query with Custom Post Types
- How can i list custom post type categories?
- IF statement in a do_shortcode
- Post the content of a specific “Custom Post Type” post within a post using a shortcode
- Why does using WP_Query inside a shortcode in an elementor page cause the arguments for WP_Query to get malformed?
- Generate Shortcodes by Taxonomy
- How would I create a shortcode to display a custom post within a page or regular post?
- WP_Query is printing out only one post when posts_per_page is set to multiple
- Shortcode insertion in tab
- How to display Custom Post Type Post based on Tag with Shortcode Parameter?
- How to enable shortcodes in a custom post type?
- Get custom fields from a custom post type with a shortcode
- Shortcode for display posts in wp-editor
- Display Recently Added Custom Post Types with Custom Taxonomy Shortcode
- How to render a custom post type template with custom fields using shortcode
- Form action/link to render a plugin in WordPress front-end
- custom post type category count shortcode
- Display Child Pages of Custom Post Type Parent Page
- Shortcode to display Staff post type based on Location post type and Specialty post type
- wp_reset_postdata() and wp_reset_query() inside shortcode are not working to reset original page query
- Next Post links not working in custom post type shortcode
- Foreach inside shortcode not working as planned
- Can a shortcode included in post content add styles to the ?
- How to retrieve category of a post in have_post loop?
- Checking if looped item has a parent inside a shortcode
- get_post_meta is not working inside shortcode
- the_post() is printing titles in page footer
- Add custom attributes to a post
- Shortcode leaves no space for other elements?
- How can I add a shortcode to query Custom Post Type with ACF in WordPress?
- Get Posts by Category, Tag , and CPT Taxonomy
- post_type internal ID?
- Run shortcode in custom script in wp_head if post type is CPT ‘Jobs’
- Shortcode is displaying the content on top of the page [duplicate]
- Filter content in shortcode
- Shortcode with WP_Query more than once on one page
- posts within custom post type all share the same content in the front-end
- Shortcode to return single custom post based on post taxonomy
- Change post type depending on shortcode
- Looking to Customize YouTube Video Embeds
- Shortcode / WP_Query in post changes context
- Custom Post Type or Shortcode, What to choose? [closed]
- Modify a plugin function output from another plugin
- Problems making shortcode with custom post types and taxonomy
- Using Custom Post Meta Values in Shortcode
- display custom portfolio tags
- Content in WP Editor displayed below CPT shortcode [duplicate]
- Shortcode in pages or tempate files for custom post type
- How to make post templates to include shortcodes only?
- Get Posts List of Current Selected Custom Taxonomy in Shortcode
- php dynamic content inside shortcode
- How to show Custom Post Type – Case Study using Shortcode & ACF
- Alike Shortcode using in Custom Shortcode
- Show in an entry a Custom Post Type associated to a post
- Display CPT Category List as Shortcode
- Shortcode with loop stacks output
- Custom post type shortcode
- How to display the post using a shortcode in WordPress?
- How can I use javascript in specific posts without relying on a plugin?
- WordPress shortcode to pull product post data
- How to generate auto shortcode for custom post type same as Elementor Template?
- From CPT Custom Loop into Shortcode?
- Custom Post type shortcodes
- Custom post type shortcode with taxonomy attribute not working and no errors
- Shortcode and get_template_part
- How to seperate posts by categories?
- Display a list of sub-pages of Custom Post Type Parent Page
- Do not parse shortcode in CPT
- Shortcode in excerpt
- Extracting Post ID and passing through as an attribute in a shortcode
- Enable shortcodes on custom post type
- Custom meta box in editor of custom post type not working
- Plugin Error on activating
- Modify shortcode to work with custom taxonomies and slugs
- shortcode order for event custom post type
- Shortcodes in custom post fields without the_content()
- Shortcode display CPT Query only showing 1 post?
- Custom Post Type vs Shortcode: Which one is more performant?
- How to call Shortcode categories for custom post types?
- Using get_terms() as shortcode attribute
- adding a shortcode into a custom post type
- shortcode for recent custom type post
- Create shortcode for list of custom post titles with custom fields alongside
- Creating shortcodes with user created forms
- Navigation links to posts in current term shortcode
- How to Create Short Code Using Custom Post type
- Adding custom shortcode to page leads to page without styling
- custom post types shortode stays on top of other page contents. Is there a bug?
- Display posts from another page on home page in wp-editor
- Shortcode in a page to display custom posts which also have a shortcode in them
- How to loop through a custom post type using a shortcode and output each element in the loop using shortcodes
- Passing postid of Testimonial Custom Post in Shortcode Parameter
- strange issue with get_post_type() when using it in a shortcode in text widget
- select categories by ids/display terms only selected
- Display the progress of post achievement with percentage against target in wordpress dashboard