You cannot mix array syntax and string syntax in the same argument. If you start with array syntax, you should stick with that, the same applies if you start with string syntax, then you should stick with string syntax. Because you are using post__not_in
which is an array, you should stick with array syntax
<?php $query = new WP_Query(
array(
"post__not_in" =>get_option("sticky_posts"),
'paged' => get_query_var('paged'),
'meta_key' => 'Sortdate',
'orderby' => 'meta_value',
'order' => 'ASC'
) );
?>
Related Posts:
- How to order posts tag by tag?
- Use REGEXP in WP_Query meta_query key
- Order by optional meta key?
- How to list some posts first in the loop based on post id
- How to get order of posts?
- Order posts by ID in the given order
- What is the most efficient way of querying posts based on visits and date for current day?
- Query Custom Meta Value with Increment
- Show all parents and children in custom post type in right order
- WP_Query Order by Specific Post ID First
- How do I run through a WordPress loop called from a filter function?
- Order by title without taking into account ‘the’
- Order by empty custom field
- How to order posts by title after they have already been sorted by category
- New WP_Query loop in admin causes problems
- WP Query – order posts by meta field first and then order the rest
- How to make posts unqueryable/unpublish posts where ACF relationship field is an unpublished post? [closed]
- Orderby two meta fields not working
- relation OR instead of AND – Filtered term ID’s in loop
- WP_Query orderby random do not repeat infinite scroll – one loop
- Why does apply_filters behave different inside and outside a loop?
- show most viewed post
- update_post_meta() not updating
- How to order posts, that have already been filtered by custom taxonomy, by their category names?
- WP_Query doesn’t works inside loop
- Display three sequential posts on each page load, without repeating previous
- Sort by meta key within same day
- Add filter to Orderby Parameter using Array
- Order by multiple meta keys on wordpress
- loop through custom post types with meta data
- Woocommerce set loop_shop_columns to be 3 in the main shop page loop only and 4 otherwise
- View related categories in order of posts
- modifying the loop multiple times with arguments passed through ajax to wp_query
- WP_Query causing links to not work
- Order posts by more than one variable (meta_key and publish date AND time)
- Create custom order sortby based on array of id
- Fetch only categorized posts
- get_post_meta for Custom Post Type ( CPT )
- Continue loop after $queryObject
- query_posts() doesn’t seem to be called in my page
- WP Meta Query at depth 2
- Some doubts about how the main query and the custom query works in this custom theme?
- display post multiple times based on array of dates
- Best way to Order Post in Home without a plugin
- Retrieving category pages from subcategory returns empty sets
- orderby in WP_QUERY – Use the order from the Dashboard
- How to make a wordpress loop file that displays posts based on certain conditions
- active link for most recent post on vertical tabs
- 2 Loops on one page – pagination of 2nd loop ignore array of excluded posts
- WP_Query with child element
- Pagination returns 404 after page 20
- Problems with WP_Query, Loop, a condition and Posts per Page
- Find by post_meta, then sort by post_meta, then sort by date (wp_posts)
- Query All Attachments and Order by Parent Publish Date
- Ordering Posts by parent category, name ascending
- WP_Query secondary query failing
- custom query – offset to pagination
- WP_query for posts with same post type AND same post category
- Order Custom Field by Price
- How to solve this script problem in theme directory?
- Custom query with post_class filter using current_post not working
- WP_Query Posts by Metadata from Option Tree
- Custom loop – Isolating post meta output depending on current query taxonomy terms
- WP_Query a custom field value bringing back 0 results
- Set Transient on CPT
- Sorting Posts with meta value not working
- Issue in If else condition [closed]
- Create multiple sections for all categories and then queries all the posts for each of those categories
- Pagination not working with WP_QUERY
- Using orderby with 2 meta keys
- Show posts in category
- Both WP_Query and get_posts returning 1 post
- Custom search (wp query by custom fields)
- Order posts by custom column using pre_get_posts
- Iterate through ID’s in loop
- How to get several fields from wp_query?
- Sorting is not working in WordPress WP_Query
- Add custom WP_Query after the first 3 posts
- Load 3 posts in flexslider slide [closed]
- Loop through multiple custom fields with increasing number
- WP_Query for attachments without duplicating post_parent and displaying tagged image
- Different number of posts showing in development vs production server
- Issue with WP_Query (need a array of selected ID’s)
- Order WP_Query results in order other than ASC or DESC
- How do I display posts with specific value in a custom field into my loop?
- Show sticky post before other WP_Query
- WP Query to order posts by multiple meta fields
- List ALL posts within last week from current category on category page
- Return a single custom post from multiple meta queries
- Custom query to order by multiple taxonomies
- An archive page without post format (just standard post)
- Filter WP_Query output before it is accessed (pre_get_posts)?
- Custom post type archive organized by category
- Custom Search Query – include only custom fields and title
- Limit the number of posts from a specific category on index.php
- wp_query display posts based on day
- Multiple wp_query loops showing first 5 posts on all pages instead of older posts[Resolved]
- Sorting Posts Based On Meta Value Using AJAX
- Sorting: custom query with orderby meta_value_num THEN by title
- query_posts with sorting on a custom datestamp