I have searched questions and answers similar to mine but with no luck finding the answer I need.

I have authors (about 8,000) and I have custom post types (about 15). I need my search function to allow queries for an author and CPT.

This url structure "/?s=%20&author_name=joesname" returns all posts across CPT's.

But if I add "&post_type=blogs" for the full url to filter for the CPT

"/?s=%20&author_name=joesname&post_type=blogs" it does not filter for just blogs.

I need to do this for every author and CPT.

This has been driving me crazy for weeks. Any help would be greatly appreciated.

  • What did you get when adding "&post_type=blogs"? Same with "/?s=%20&author_name=joesname"? – 1fixdotio Feb 7 '14 at 3:38
  • Hi @1fixdotio ! With "/?s=%20&author_name=joesname" it returned all custom post type content. When I added "&post_type=blogs" it returned all the same content by all custom posts types. – user2591811 Feb 7 '14 at 4:41
  • I think this post could solve your problem: designpx.com/tutorials/custom-post-types-author-archive. – 1fixdotio Feb 7 '14 at 7:47
  • @1fixdotio Thanks for your suggestion. I tried adding the code recommended on that page to my functions.php file. Unfortunately, I see no change. My search results already display all post types. But I need a url similar to this: "beta.org/?s=post_type=blogpost&author=alberteinstein to be able to filter for any post type specifically and by author, for example, all blogs by Albert Einstein. – user2591811 Feb 7 '14 at 20:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.