I want to hide my custom post type from search results. So, I followed the codex and used:
exclude_from_search => 'true'
while registering my custom post type.
That hides the custom post type and it does not appear in search results any more.
But now I am unable to load posts using get_posts
but they appear fine with WP_Query
. I wonder why it is happening.
get_posts()
fails for you?