In my single.php template under the post content I have the code for a shortcode with some html between the opening and closing parts of the shortcode.
Within the html I would like to display the post ID, however the usual method ‘<?php the_ID(); ?>’ doesn’t seem to be working. There’s probably a simple way to get around this – can anyone advise me?
‘<?php echo do_shortcode(‘[hide-this-part]
this is where I put my html…blablabla…
This is before the end of the loop.
Thanks a lot for any help you can give me.
- The topic ‘Displaying post ID within shortcode php in template’ is closed to new replies.