Peter @ WordPress – Get ID by post or page name
- Alias: Peter
- Skickat: 2009-04-03 @ 19:22
- Kommenterat: WordPress – Get ID by post or page name
Thanks, this is just what I was looking for – I need to pull a post id from a post slug for something different, and this did the trick.
It’s worth noting that post_name actually holds the slug (generally the post name with dashes inserted for non-alphanumeric characters), and post_title actually holds the title of the post.