• Hello, I have made a shortcode to show POST ID – it works inside a post, but when I use the same shortcode inside a Query Loop Block, I am getting the same result on all posts in that query.

    Code for ShortCode

    function getPostID() {
    	return get_the_ID();
    }
    add_shortcode( 'getPostID', 'getPostID' );

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can’t Get Post Data (ID/Custom Fields) with ShortCode inside Query Loop Block’ is closed to new replies.