I am using a Visual Composer (Post Grid) element, with a custom template.
I'd like to output the post id via a shortcode, so I've created a simple shortcode:
function myshortcode_title( ){
return get_the_ID();
}
add_shortcode( 'page_title', 'myshortcode_title' );
but it doesn't seem to retrieve the post ID. I am adding it to the grid via a Text block.
The shortcode works on any other page, but not inside the VC post grid.
How else can I access the post ID inside the post grid?
Thanks in advance! Here is a screenshot of the element.