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
- Get the ID of the latest post
- Get all image from single page using this query
- What is the most efficient way of querying posts based on visits and date for current day?
- How to tune search argument in WP_Query to show only exactly the same results?
- How to modify the query to exclude posts by slug?
- Exporting Data from WordPress into a flat table
- How to remove duplicate query on page load or make them cacheable
- wpdb::prepare() isn’t working
- Pull post meta with post_query?
- How do I have WP_Query match posts based on search parameter OR meta fields? (rather than search parameters AND meta fields)?
- Query based on title, with ‘compare’ => ‘IN’
- Plugin will sort users by usermeta
- Query posts by meta_key whose value is an array
- Exclude from the query posts with meta_key and meta_value
- empty query breaks other queries
- Problem in exploding the_content to array
- Meta_query ‘compare’ => ‘LIKE’ not working?
- Nested array issue in meta_query
- WP_Meta_Query object with conditionals
- How to rearrange a pool of posts joined using two queries?
- wpdb update multiple row?
- Custom query Custom-Post-Types creates error
- Formatting a date/time returned from a custom $wpdb query
- How can I query for posts using a date stored in post-meta?
- Hook into the Admin Dashboard and redirect users
- How to get posts by meta value as multi-dimensional array?
- Prevent versioning for .woff (font) files
- How to set meta_query if get_post_meta returns nested array for that key? [duplicate]
- OR condition not working
- Pagination not working on my archive page for a custom post type
- Sort Events by Venue Title – Sort Post set by related post ids
- how to get postmeta info based on multiple categories?
- Add Hook for clearing transient when post is added
- query by meta value then date and not empty meta value
- Modify Global Posts Plugin
- SQL Query : how copy all tags of post into their post content in wordpress by sql query