How to Combining Two WP_Query in One Main Query

Prem Tiwari - - 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.

Prem Tiwari

Prem Tiwari is the founder of and also a professional developer and a blogger by hobby.

Tags: , , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.