• Resolved hmmiis

    (@hmmiis)


    I’m trying to add the “is_featured” value that can be set in the publishing options of the advert-posts into an RSS feed.

    It seems the value isn’t included by getting all post meta information with get_post_meta( get_the_ID()).
    Trying to get the value with possible combinations like get_post_meta( get_the_ID(), "is_featured", true ); don’t seem to work either.

    How can I read the “is_featured” extension set for an advert to dump the boolean value of the checkbox, or add it as a value to my RSS construct in my case?

    • This topic was modified 3 years, 8 months ago by hmmiis.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    the is_featured value is actually stored in the wp_posts.menu_order field in the database (maybe it’s not ideal, but it improves the search performance).

    So, when the menu_order is set to 1 the Ad is featured, if you know the post_id you can check if the Ad is featured with the below code

    
    echo get_post( get_the_ID() )->menu_order;
    
    Thread Starter hmmiis

    (@hmmiis)

    Hey Greg,

    great, thank you for the code snippet and your insights.

    All the best

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Get “is_featured” value for adverts’ is closed to new replies.