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?
- Get current menu_order
- Different post sort order within different categories
- MySQL Query to Retrieve Category from wp_posts
- what types of order can I pass to get_posts() via orderby?
- Sort posts by popularity/page views
- SQL Query for getting all posts in their latest revised state
- 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?
- Sort post by attributes ‘order’
- 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
- How to force update all posts after import
- Order Posts by Alphabetical for Each Letter
- how to limit and display tag?
- 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
- Display custom post types by date field
- Query All users that has post
- How to update serialized post meta?
- Can’t publish new posts
- 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
- Display posts from #6 to #20 on archive page
- Reset/Reorder posts ID in the MySQL wp_posts table
- How do I find which articles are missing a featured image in The WordPress database?
- 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?
- Remove a shortcode from all WordPress posts
- 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”
- Inner join overrides Advanced Custom Fields plugin’s get_field [closed]
- Make a vertical dynamic list of posts in alphabetically order and in columns [closed]
- 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
- Need to change all links in page content but not in post content
- Can’t update WordPress Page if post_content is Empty
- Restore woocommerce orders
- How to select particular month post from table and update the post status using MySQL?
- Get latest post from categories
- How do post IDs work in WordPress?
- Get author posts count after excluding a category
- Posts and order
- Adjust the order for returned posts
- get last post’s link with SQL query
- Order posts by date
- Categories Listing and Highlighting current category item
- 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
- WP query taxonomy optimization
- Save / Update meta data as multidimensional array
- Merge get_comments & get_posts into a single query
- 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
- WordPress MySQL Search and replace with wildcard?
- 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