WordPress ACF 插件前台调用备忘录

前台调用备忘录

$post_id = false; // current post
$post_id = 123; // post ID = 123
$post_id = "user_123"; // user ID = 123
$post_id = "term_123"; // term ID = 123
$post_id = "category_123"; // same as above
$post_id = "option"; // options page
$post_id = "options"; // same as above

the_field( 'my_field', $post_id );

<?php the_field('products_banner', 'category_39'); ?>