get ID from post title for shortcode
-
I’m setting up shortcodes to include a specific post.
This works ok if I know the ID of the post: [myshortcode=192] where 192 is the ID of the post: get_post(192)
However, I would like a shortcode like this: [myshortcode=shorty5] where shorty5 is the title of the post.Basically the shortcodes are in a category called shortcodes, user adds posts to that category to have new shortcodes [myshortcode=shorty6] etc.
I dont want the user to ‘go and find the ID of the post’.So, my question is: how can I use the title in the shortcodes instead of the ID -or- how can I get the postID from the title?
-thanks-
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘get ID from post title for shortcode’ is closed to new replies.