How to Combining Two WP_Query in One Main Query

| Last Updated: | In: WordPress, WordPress Beginners, WordPress Snippets


Recently, I got some tutorial request via my blog, so that I am going to create a tutorial to solve the issue asked by that guys. The question is “How to Combining Two WP_Query in One Main Query”. Sometimes we need to perform the two condition and merge in one WP_Query to display the result on the front end website.

How to Combining Two WP_Query in One Main Query

Below is the simple tutorial to merge the two WP_Queries in one WP_Queries and display the result. Copy the below code and change it as per your requirement. This is simple and easy code, In the below code I have used the array_merge() function to merge the two array.

I hope this tutorial helped you. If you still need any help, feel free to add your comments in below comment section. I will be happy to help.

Do you like & share this article with your friends, and don’t forget to follow us on Facebook and Twitter to learn cool WordPress tutorials and also don’t forget to subscribe my blog to get all future tutorials directly in your mail box.


About: Prem Tiwari

Prem Tiwari is the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies.


You may also like:


, , , , , , ,