WP 記事IDからカテゴリ・タグを取得

<?php
// カテゴリ
$cats = get_the_category($post_obj->ID);
foreach ($cats as $cat) {
    echo $cat->name;
}
// タグ
$tags = get_the_tags($post_obj->ID);
foreach ($tags as $tag) {
    echo $tag->name;
}
?>

記事IDからカスタムフィールドを取得したい時: main_imgというフィールドを取得したい時は、the_field('main_img')の第2引数にIDを入れれば取得可能です。

<img src="<?php the_field('main_img', $post_obj->ID); ?>">