Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question
    
What did you get when adding "&post_type=blogs"? Same with "/?s=%20&author_name=joesname"? –  1fixdotio Feb 7 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 at 4:41
    
I think this post could solve your problem: designpx.com/tutorials/custom-post-types-author-archive. –  1fixdotio Feb 7 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 at 20:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.