I'm looking for a way to search through posts by ID, preferably with support for custom post types. I was hoping there'd be a plugin enabling this functionality, but I've failed to find anything. Any ideas would be greatly appreciated, thank you.
Tell me more
×
WordPress Answers is a question and answer site for
WordPress developers and administrators. It's 100% free, no registration required.
|
|
Not sure i understand why you'd want to query by ID, but that said it's possible in a hacky kind of way(i like this method because it's simple).
All you then do is search using the regular search box using a
..would return the post with an ID of 123. I'm sure there's more complicated routes that could be taken to do this, but i don't see any issues with this approach, unless you have lots of posts with titles that start with a hash(but you could always swap the hash for another character). Hope that helps. :) |
|||||
|