At first glance, I would think your query isn’t correct. Are you echoing out the variables to make sure they are correct? If you are setting
'post_per_page' => 4
and you are getting 5 posts, then something seems a bit off. Where it is a number, I believe you can leave off the quotes around it. If that doesn’t fix it, I would echo out $meta1 to make sure that is querying correctly, then I would even try
'order' => 'DESC'
Related Posts:
- Order posts alphabetically: how to set order=asc in mysql query?
- how to get post order by post id wp_query?
- How to Change Order of Posts in Admin?
- Different post sort order within different categories
- MySQL Query to Retrieve Category from wp_posts
- Sort posts by popularity/page views
- How do I reorder (pop and push) items from WP_Query?
- How to query serialized array by comparing greater than (>=)?
- How to put last edited entry on top of the blog-post list?
- How to sort posts by last name (2nd word) on ONE category only?
- Search & Remove Specific Shortcode From All Posts
- Manually delete post from database
- Query posts from current year
- Reverse chronology of post listing
- JSON not valid after json_encode posts
- Order Posts by Alphabetical for Each Letter
- Set number of article per number of page
- Problem ordering posts with numbers for titles numerically E.g. 1, 10, 100
- How to choose a sort order (for posts) per category? (ideally when creating a new category)
- Order post by year DESC and month ASC
- How to update serialized post meta?
- orderby=meta_value_num creates duplicate posts
- Change Order of Admin Posts Depending on Meta
- Display posts in alphabetical order for a particular category
- Manually removing revision post types
- post re-order on my site
- Reset/Reorder posts ID in the MySQL wp_posts table
- Tags to Post-ID mysql query. Tag Search
- Why orderby=”date” does not support manually changed posts?
- WP_Query orderby not working with meta_value_num and menu_order
- How can I sort posts by the date and a custom meta field?
- wp_insert_post – duration
- Insert woocommerce products programmatically with featured image and gallery
- Sort WP posts by span value
- Add multiple tags to multiple posts
- How to sort posts inside categories
- Get user categories with most posts in it
- MySql query to get posts with all meta and terms
- Any way for get_next_post() to use the actual post order instead of publish order?
- List authors with the last post title and order by last post date
- How to order posts by meta_value and title
- How to Mysql select a list of posts with meta_values AND all relevant categories?
- What do these phpMyAdmin errors mean on my WordPress databaes?
- How Do I Get My Post Tags to Alphabetize?
- What happens if I delete all the rows that represents a post revision from the posts table into WordPress database?
- Grouping posts by a custom meta value
- While loop articles – if statement order
- Delete post results in “Cannot delete or update a parent row: a foreign key constraint fails”
- Create a list of posts with topic headdings
- update image path with words starting uppercase to lowercase chars
- How can I add a box to edit Order on a regular post?
- Queries take 120+ seconds on my large WordPress site
- Database hacked – random posts are modified
- get_previous_post() while accounting for sticky posts
- Querying another post category to match current post and display in loop
- Need to know custom code to display random and most viewed posts in wordpress posts and pages
- Can’t update WordPress Page if post_content is Empty
- Restore woocommerce orders
- Get latest post from categories
- How do post IDs work in WordPress?
- Get author posts count after excluding a category
- Order posts by date
- query for filtering published posts?
- MySQL: Possible to replace all of wp_posts.post_content(id#) via UPDATE + REPLACE + SELECT?
- Deleting post tags removes categories
- Return records between two meta datetimes saved as strings
- Save / Update meta data as multidimensional array
- MYSQL: Create SQL query to search for string and replace
- Query to fetch custom taxonomy along with post title
- Query custom post type custom meta key
- Mysql update menu_order problem
- Bulk find & replace on WordPress posts/pages (minus image paths)
- query posts with selected post ids first
- Add postmeta to all blog posts
- Using Orderby and meta_value to order natural/alphanumerical
- ‘posts’ table should not store the absolute image path
- Dev and prod on the same database- dev version active for IOS
- load post data into mysql
- How do I display posts ordered by a date custom field?
- WP_Query sort by meta_value_num or date
- Allow reader to reorder posts for themselves (oldest first)
- SQL trigger failes with post_content
- How to make post button to a random post
- I am not getting result from php function that is json encoded
- Converting Posts to Pages
- Where is object, property or label in the database that controls the order of the posts being displayed?
- How to change the publishing date of each posts?
- Get current user array with post string
- Delete junk text from all the post using my sql command
- Sort Posts Alphabetically by Multiple Categories [duplicate]
- FIND and REPLACE wp_posts AND IGNORE custom post type mysql query
- Why is $_POST Empty in Profile Edit Admin?
- Last three posts not being put in order by date. How to fix this?
- Order by ‘s’ using WP_Query()
- How to create a post based on data in a table?
- If meta_key exists then don’t select this post?
- posts_per_page – Repeats only first posts ‘post__in’ array
- Custom Admin Post Column change order
- How to update wp_posts with just the returned comment count from wp_comments (SQL GROUP BY)
- How to sort posts alphabetically based on a specific parent category