Include all your WordPress custom post types in search
Posted on This might be outdated!
What i love in WordPress 3.0+ is the fact that you can create as many custom post types as you want to properly separate your contents. And there’s something i see pretty often when when i’m working with people that use CPTs: their CPTs are not included in their search, and that’s big problem because some of them nearly don’t use posts but only CPTs, so here is a quick tip to explain you how you can automatically add your CPTs to your search. Adding WordPress custom post types in search has never been so easy.
Just add this code to your theme functions.php file or in any file of your plugins:
Nice bit of code Remi ;)
Awesome, this will come in handy, thanks :)
You’re welcome !
but can i include from my custom table in search ..?
[…] + mehr hier sehen […]