It will work with the SORT_REGULAR
flag:
array_unique( array_merge( $q1_posts, $q2_posts ), SORT_REGULAR );
Related Posts:
- Can an array be used as a meta_query value?
- How do I dynamically generate args for wp_query?
- How to use $query->set with post__in?
- Exclude posts based on meta value
- Getting posts to exclude from array
- Get all posts as an array ID => Name
- extract serialized array to use for wp-query
- How can I split my query result in 2 arrays?
- array_rand not working correctly?
- Order a WP_Query by meta value where the value is an array
- Using multiple variables to assign categories to an array
- Sending simple variable on single page to WP JSON
- in_array not working on dev server but works on localhost
- How to initialise WP_Query on the basis of a specific meta_value and continue iterating rest?
- How do I use WP_query with multiple post IDs?
- Include WP_Query in my own PHP file?
- Inject post (from specific category) between posts in Loop
- is_page() not working from within a plugin
- Metabox repeating fields – radio buttons not saving correctly
- How can merge two arrays values in one array and save in database
- Passing JSON data from WP Query into AJAX causing NULL errors
- Display certain amount of posts on taxonomy archive page
- Compare two meta key values against each other inside the get_posts array?
- How to add 2 posts under another post? Formatting should be intact
- what is diference wp_get_attachment_url / wp_get_attachment_src / get_post_thumbnail_id?
- Modern Tribe Calendar wp-query with meta query not working at all
- Count number of published posts by type
- How to display custom field on homepage
- Can’t increase posts_per_page by variable
- List of posts by day of the week
- Get taxonomy terms only of the WP_Query current posts
- ‘orderby’ => ‘rand’ alternative for better performance?
- Use WP_Query in shortcode
- Why is variable not working on custom sql query using wpdb?
- How to do multiple searches (with logical OR) in WP_Query in hook pre_get_posts?
- Create shortcodes within foreach loop (using array)
- get current custom post ID by WP_Query method
- How to securely provide a $_POST var in WP_Query with PHP 7?
- Create WP_Query to search for posts by their categories or their parent/child categories
- If Query In Sidebar
- Reprinting tags with all attributes
- Checking array against author id in loop
- Security for data obtained from the database
- How to get all author posts outside of author templates
- Grouping posts by a custom meta value
- How to get post ID in a Page?
- How to overwrite orderby with add_query_var
- Error while setting role
- How to override url params with rewrite rules vars?
- How to display SQL query that ran in WC_Order_Query?
- Loop over Array and get the distinct ids
- Store metakey value as an array
- Remove empty terms from array, sort alphabetically, update back to repeating field
- Only show first image in foreach loop
- Post not populating for custom post type based on category selection
- Filter by field with array value in ACF on WP REST API
- Infinite Loop – WP_Query
- echo var into wp_query
- add the value of a variable returned in a while loop [closed]
- using images in next/previous_post_link [closed]
- WordPress SQL JOIN query
- WP_Query and help with the loop for magazine front page
- How to WP_Query posts order by parent title?
- search.php to search only the post title
- WP_Query – How to query all of post types categories
- How to work Woocommerce pagination inside shortcode?
- Convert a column of a table containing an Array as response in HTML
- Display just one post from a loop of 5 posts?
- Using a new WP_Query inside the loop
- wp_Query with mutuplea values returns all posts
- How to get specific multiple pages excerpts at homepage?
- Use WPQuery to match to specific repeater row in post
- WP_QUERY post_in problem
- how to get data from two different table from wordpress database
- How to insert multiple rows and columns in database using array
- Assign meta_query value to php variable
- ACF – Get ID of relationship field in flexible content
- WordPress search query, how to modify the sql
- Modify post image in full size
- Wp-query output correct, but the loop shows one less item (only sometimes)
- How to display sticky post always at the top (before regular post) in wordpress?
- Transfer WordPress Login Session to an Extended Webpage on the Same Domain
- Get a list of tags present in a paged front page
- How can I display a query in a page?
- direct query to post_meta table
- Page returning ID from array, how to return the correct values for post in acf wordpress
- Auto remove empty values in array
- Unserializeing multiple column values that are stored in one database results variable
- List sibling pages widget, exclude current page
- wp_get_archive for category returning different URLs on different but similar sites
- get_permalink returning first letter
- Does wp_query and query_posts affect website performance? [duplicate]
- WordPress post pagination on custom template not working
- Ajax Load More or View More functionality for woocommerce category layout by template overriding
- save array of objects with update_option
- How do I run the following script from my articles page?
- Three different queries on same page
- Replace block content with an array
- How to sort search result by post_title, then by post_content
- How to get posts by a certain author in inner loop using outer loop variable or post title WordPress