Find The problem 😉
The answer is
$hot_args = array(
'post_type' => 'video',
'posts_per_page' => '6',
"order" => "DESC",
'meta_key' => 'post_views_count',
'orderby' => 'meta_value_num',
'date_query' => array(
array(
'after' => '1 week ago'
)
),
"post__not_in" => $posts__not_in,
);
$hot_query = new WP_Query( $hot_args );
There was not video as my custom post type exists in the past week so the there was nothing to return 🙂
Related Posts:
- Query all posts where a meta key does not exist
- Meta query with boolean true/false value
- Get post with multiple meta keys and value
- How Do I Use WP_Query to Run This Database Query as Search Result?
- Can’t sort order of wp_query with 2 meta keys
- Query for posts from any post type but only add instock products
- WordPress Orderby Numeric Value Not Working
- orderby in custom WP Query does not work
- Display custom post type from dynamic custom field
- WordPress request fiter order by related post’s post_title
- Displaying a div from an assigned meta_value when on a page
- How to get specific post meta by title or id
- $post->post_meta not pulling any post in wordpress/php
- WP_Query of custom post type sorted by meta_key has unexpected results
- Returning a custom content types with meta values
- WP_Meta_Query object with conditionals
- How to retrive Custom Post Type Meta Fields in Custom WP_Query
- After inserting new post with wp_insert_post() the post is not visble to WP_Query, but the same WP_Query works for post inserted from wp-admin panel
- Use WP_query to match post types based on custom field values
- How to sort by multiple values in a nested WP_Query
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- How to get post by meta value
- How do I get all authors posts of a custom post type outside loop
- Linking posts together with Advanced Custom Fields “both ways”
- How to get Current week and current date record wp query
- get_post_meta for Custom Post Type ( CPT )
- WordPress custom post type
- Custom Post Type meta oembed html output resulting in WSoD
- Values inside a custom field to determine which category posts to display
- Querying meta values within an array
- Get posts for custom post type with WP_Query
- Number of pages – multiple (custom) post types
- Enforcing canonical URLs with multiple custom post types
- Post metadata deletes itself
- WP_Query -> sort results by relevance (= most tags / taxonomy terms in common)
- Get latest 4 post on a custom post filtered by category
- how to group custom post type posts by custom taxonomy terms
- Custom Post Type: Set post_title equal to a custom post type field
- I can’t set meta_key in my custom post type query
- wp_query and comment_parent – select only posts with top level comments
- Comparing timestamps in meta query doesn’t work
- Include both default and Custom Post Type in query modified inside pre_get_posts
- How can I include meta box content when searching?
- List all custom post type posts from a given category?
- Automatically adding meta data to posts or multiple query help
- Trigger “unsaved changes” dialog for custom post meta changes
- Conditionally Query Custom Post Types by Post Meta for Blog Home Page?
- Loop on front-page.php
- Querying Term Posts in Loop
- how to interconnect custom post types?
- Can’t get order_by meta_value_num to work properly
- Linking to the most recent post in a Custom Post Type
- How to make sure content doesn’t display if selection is empty
- Notice: Undefined index: error and understanding wordpress
- Creating a navigation menu of all posts of a custom post type and their children posts?
- Custom Post Types. Are there any disadvantages/advantages in using a plugin to develop them?
- How do I create an archive page as a including metadata?
- Two Custom Post Types Many to Many Relationship
- Update postmeta Parent when post_status child change
- Update database from Quick Edit according to Checkbox state of Custom Post Type
- Order posts by 2 custom fields and if one custom field is zero orderby another custom field
- WP Query post__in not returning correct results
- Proper way to display latest 5 posts grouped by post type?
- Detect inside a custom query the kind of post type to assign custom classes
- Check if post with same meta value exists
- Do posts, pages and / or custom post type objects have unique ID numbers or can there be multiple objects with the same IDs?
- Archieve.php not loading for custom post type
- get_pagination not working on a custom post type query (using WP_Query)
- WP_Query with custom post type ID
- Query all post and CPT from 2 specific taxonomies AND by ACF custom field
- postsperpage value not being applied
- Cannot obtain custom meta information
- Exclude latest post from WP_Query taxonomy term loop
- Save Metabox Custom Field Value
- Getting titles from an array of IDs
- Empty meta-box returns publishdate if no value is set?
- Display featured posts for a custom post type by taxonomy
- Custom Meta Box with variable number of fields
- What is the most efficient way to execute recursive complex queries?
- date_query empty results with custom post type
- conditional filter
- display post count in archive page that have relation with another taxonomy term
- How can I sort the results of a REST API response by the title of a connected custom post type?
- Query when is one or several values
- Problems in paginate_links with custom query loop and MB-Relationships
- Post Filtered by Custom Field Value
- Stored meta from attachment, video length?
- Delete custom post type metadata without deleting the post in admin area
- Imported Content Doesnt Show Up On Frontend
- Order by post meta value gets random results
- How to load more custom type posts through AJAX & LOAD MORE POSTS button
- Pagination always adding “Next” link when results come from Custom Post Type WP_query
- Rich Custom Field for Custom Post type not saving
- Pagination not working on homepage
- How to query custom post then display sections by meta value
- Using tax_query to get single post per category
- Show Posts in Vertical Tabs with Scrollbar
- How to manage wordpress knowledge base/wiki/posts collections
- Is it possible to make is_category() recursive?
- Get X posts with the same terms as the current post (custom post type and custom taxonomy)