Try the below $args instead, the one you have right now is looking for liked_by_user_id > than the current user id.
$args = array(
'post_type' => 'post',
'posts_per_page' => -1,
'orderby' => 'date',
'meta_query' => array(
array(
'key' => 'liked_by_user_id',
'value' => get_current_user_id()
)
),
);
The above $args should return all posts by liked by currently logged in user.
Related Posts:
- Query metas (and not : query posts by metas)
- Order by meta value pro first then meta value free in my search function
- get_post_meta with WP_query
- Is there any way to get all custom posts and all custom terms with it’s meta in few queries?
- What is the best way to query posts based on live data?
- How can I create a meta_query with an array as meta_field?
- How can I query all users who registered today?
- Search custom post type by meta data
- Custom Queries: Joining On Meta Values From Two Custom Post Types
- Query Custom Meta Value with Increment
- Perform query with meta_value date
- get_post_meta causes database queries
- WordPress creating excessive joins on meta_query with search
- Filter query posts by the count of metas for a meta key
- Get posts by category with pure SQL query
- Save default value for empty or missing post meta
- Grouping related postmeta data via SQL query
- Query all posts and not repeat the same tag
- How can I apply a meta query for a single custom post type in the main query?
- How do I find if a page has a template?
- mySQL query. ORDER BY meta_key
- Remove posts from query for events whose start date has passed
- How to check current user in meta value array in WP_Query meta_query
- How can I sort homepage by a meta value?
- Get posts between custom dates
- Fetch Record based on meta key dates
- How to orderby multiple meta fields with another meta query
- how to make members list directory through wordpress post custom meta key.
- Issue with using add_rewrite_rule() for post querying custom fields
- Query returning same results even though the ID changes
- Query posts according to specific post meta values
- Exclude posts by post meta value
- Change the destination of the URLs in post.php
- get_users with array as meta_value
- Declaring a var, placing it in a query and using the output of the query?
- Why doesn’t my WP Meta Query return any results?
- WordPress Mysql query and Duplicate
- WP_Query meta compare must include ALL array values
- Combining two meta_values within one row with query
- Excluding posts by meta, and also keeping posts without the meta
- How to “orderby” the first array in a meta_query that uses multiply keys?
- Change pure SQL database query to WordPress post query?
- How do i create a custom post query when the meta value is an array?
- meta_query not working
- WordPress query: merge meta key (number) values and sort
- Use WP_query to match post types based on custom field values
- Query against multiple locations within single custom post type post
- Restrict WordPress search to a single ACF field
- Query Post interferes with Pagination
- I need query_posts() to order results first by a meta value and then by post ID
- My archives page won’t sort posts by month
- Sort by postmeta on when searching
- Fastest and most efficient SQL query to check if UID exists
- Ordering Posts By Meta Data
- Use $wpdb->get_results with filter based on array
- Query Posts that have or don’t have a meta_value and order by the same ASC
- meta query always fails even if data is correct
- Ordering posts alphabetically by meta keys and title
- Custom MySQL Query for Post and Post Meta
- How to query post ids liked by the Author
- list or get meta_key where meta_value is ‘something’
- WP_Query orderby meta key/value suddely stopped working
- ‘Active lotteries’ only custom query for woocommerce lottery plugin and elementor
- Meta Query compare with LIKE pulls similar post types: 55 and 155, and 1,155
- Rewrite Query_Var URL Parameter with Slug
- Does wp_query and query_posts affect website performance? [duplicate]
- How to query different categories on index?
- WP_User_Query. Whats wrong with ‘relation’ => ‘OR’
- WordPress: paginating array using a foreach
- wordpress last all added get meta value by post id
- Query posts by meta value and sort by another meta key
- How to specify what kind of is_single post?
- How to get one result using wpdb class?
- WordPress Unknown Query
- Can’t See Media Queries with Inspect Tool [closed]
- How we insert values into database using metabox WordPress?
- SQL Query : how copy all tags of post into their post content in wordpress by sql query
- Filter Query Post by Custom Fields(by date)
- Print data from wordpress sql query
- How to add multiple values with add_query_arg?
- Delete query won’t run
- List of buyers for each product
- Limiting the amount of posts this displays
- Where can I find the SQL to get the most used information by wordpress database?
- query posts only works on the first page
- Get Posts ordered by a date custom meta field
- Custom Query for wp_posts using wp_postmeta
- Query parsing only author ids
- WooCommerce Total # orders [closed]
- What is the best way to cache pages and queries in WordPress?
- 3 queries to update WordPress
- Check for custom field value in different post type than current one and do something
- WP Query outputs three items within a div
- Can I create my own query in wordpress with traditional methods?
- WP_Query by meta key not returning any posts
- Modify a query using both a text field and a true/false AFC field
- How do I troubleshoot Maximum execution time of 60 seconds exceeded in updating a Media File?
- Query filter on custom post by current author in post widget for elementor query id
- update $wpdb one query
- WP Query – Show custom posts only if user contain some user meta