Custom post type Shortcodes wordpress July 27, 2022 by Tarik Billa Use get_the_ID() instead of $post->ID This will fix your problem