Support

Account

Home Forums ACF PRO Display metadata of post object? Reply To: Display metadata of post object?

  • You can get the published date with something like:

    $publishDate = get_the_time('F d, Y', $featured_post->ID);

    Change the format there, as needed. You’re getting the error on categories because of how you’re trying to spit out the $categories variable.

    $categories will be an array of categories so to display them, you’d want to loop through the array. I don’t know what you want from the category (a link to the category, just the name, etc.) but it’d be something like:

    foreach( $categories as $category ) {
        echo $category->name;
    }