WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Sorting Two Queries (2 posts)

  1. joshrodgers
    Member
    Posted 2 years ago #

    Basically I have a website that has regular posts and custom post type posts. They share categories...like officer, member, etc.

    if I query the category name it'll return only regular posts and leave out my custom post type posts. However, if I query the category name with the post type it only returns custom post type posts and will leave out my regular posts.

    Is there any way I could query the category name of both of them so WordPress will return my regular posts and custom post type posts?

    I tried creating two queries, which works, but puts the results side-by-side. I want it to return the results all together. Any ideas?

    Thanks,
    Josh

  2. joshrodgers
    Member
    Posted 2 years ago #

    I figured it out!!

    I used an array to query both my posts and my custom post type posts, I used the following code: http://pastebin.com/r2a304Ft

    In the array "post" returns my posts and "inductees" is the name of my custom post type. Hope this helps someone!!

    Thanks,
    Josh

Topic Closed

This topic has been closed to new replies.

About this Topic