Getting post ID using function
-
Hey guys. I’m building my own theme for WordPress, and am still a bit new to this so I need a bit of help ??
I have a feature I built into the template that allows the user to email the current page to a friend, it’s a plugin, and the way it works is collecting the User ID and sending them to another page like:
https://domain.com/email/?id=5
It works, but I want to have the same thing happening somewhere else on the template, hence I need to copy what the plugin does and put it in a new a tag if you know what i mean. Problem is the plugin uses PHP for everything and I can’t for the life of me see how it gets the post ID.
SO, if anyone knows how I can get the post id (not the permalink) for the current post I’d be extremely grateful ??
Cheers!
- The topic ‘Getting post ID using function’ is closed to new replies.