$is_featured_post = get_post_meta(get_the_ID(), 'is_featured', TRUE);
This will return the value in the variable and you can check your condition.
Instead of get_the_ID()
, you can use any post ID
. Refer the documentation here: get_post_meta.
Related Posts:
- Display featured products through custom loop in WooCommerce 3 [closed]
- Display Featured Post by Categories and Avoid duplicated posts
- Display single most recent post in category on every page of category archive
- How to show featured post first, then separate loop for other posts
- WordPress get_posts function, 1300 lines long
- Exclude a category if post is only in that category using wp_Query
- Too slow when using both ‘tax_query’ and ‘meta_query’ both in WP_Query
- Use of caller_ get_ posts
- Tax_query terms ID’s using variable
- Initiating WP_Query() with no args and adding them later through the query() method
- Pagination custom query
- WP_Query and name__in
- Order posts by tags count?
- Querying Multiple Custom Taxonomy Terms
- WP Query with offset breaks wp_pagenavi or any pagination
- Show list of authors with latest post NOT older than a month
- Unable to combine “search value” and “tax_query” using WP_Query
- How to extend tag and category “Related Posts” query to custom post_type if the first 2 terms have no posts
- WP_QUERY returns empty set when fired from a WP-CRON scheduled event
- Interupting the loop with extra divs to display data, and how to get it to work responsively
- WP_Query, tax_query and term_meta: How to?
- Custom category search box for WordPress
- How to pass many ids in post__in?
- Sub-loop / nested loops Best Practices
- How to echo data after a WP_Query
- Query all published post AND attachment with specific mime type
- WP_Query returns random number of posts
- How do I run through a WordPress loop called from a filter function?
- How do I get the title of a category in a custom loop?
- Load More Posts Button – AJAX
- Is it a good idea to improve meta query performance by adding tax query?
- WP_Query: Group events by year, sorted DESC; then by date for each year group, sorted ASC
- How to display user order by role
- WP_Query | Tax_Query Relation | Unable to use ‘OR’ as it then allows all products, help me finish my query?
- How to list custom fields as headers and list all pages sharing that custom field under it?
- Best practice for query_posts in responsive design?
- hide custom post types with specific meta key ON admin backend
- Orderby listing issue
- Current post in AJAX call is always zero
- Multiple filter conditions for WP_Query
- Get all fields inlcuding “ACF” (Advanced Custom Fields) columns in wp_query
- why does not my wp_query work?
- How to access custom WordPress database tables
- WP_query : Force last posts number over Reading Settings
- Order by most used tag
- How to set an alternate posts_per_page value for default queries in different templates
- WP Query – posts only by specific user
- how can I get seperate the HTML in the_content(); output?
- Is wp_reset_postdata always necessary?
- wp_query: implicit paging? I get less posts that I should
- WP Query Meta Value – How To Identify Specific, Unique Values?
- Get user first name from custom endpoint
- Shortcode Not Working in Slider When Added To Post Title
- WP_QUERY with group by with custom fields
- Loading two different AJAX requests on two different pages
- Displaying pages on an archive page
- Multiple pagename WP Query
- How I can repeat 2 HTML templates in a WordPress Query?
- Loop categories by recent post
- How to add WordPress featured image via SQL
- Meta query with compare by more than 2 fields
- Insert images into wordpress post with a query
- Offset WP_Query by negative 1
- wp-query problem with author
- How to make the ‘request’ filter work?
- Filter for each loop when WP_Query has no posts to show
- Custom WP Query order function possible?
- How sort products by calculate value? ( custom post meta, price, option)
- wc_get_products() return empty object
- Pagination unique to a widget
- Ascending numerical sorting with non-numerical characters last
- WP_Query not returning custom post type
- How do I use $wp_query->current_post with get_template_part? I’m trying to add post classes (first/last/even/odd) to custom loops
- Why pagination is not working with tax_query param?
- Finding post ID dynamically on click
- paginate_links method doesn’t show second page of my custom wp_query
- ACF Post Object meta-query by title not ID
- Case insensitive ORDERBY in wpquery
- Sorting with meta_query and multiple, optional meta keys
- getting posts by tags
- WP_Query & Duplicate entries
- Query child posts with tax query on parents
- From admin edit user page query either the user_nicename or username field value of the user profile being edited or viewed
- How to set selected attribute on option after filter query?
- custom search form, posts_per_page value being ignored
- Fetching $_POST from Page Template into functions.php
- Include post_status check within $wpdb query
- Inline Ajax call after term is appended with a @ or # etc. displayed in div
- Complicated WP_Query
- Passing conditional arrays to WP_Query() [closed]
- Query custom post type by date field only working when two posts match the query
- Why isn’t my Meta_Query running?
- Custom query to show posts
- How to specify a certain amount of images queried, not all?
- wordpress sorting using array merge by price in ascending order but price with 0 must be show last
- Carousel Loop only duplicating
- Taxonomy related query not working
- error with $query->have_posts()
- Multiple Orderby is not working right
- How to efficiently find “duplicate” posts, where the titles are different, using metadata to match posts?