📜  在存档页面上的产品标题下方添加文本 + ACF - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:30.275000             🧑  作者: Mango

代码示例1
add_action( 'woocommerce_after_shop_loop_item_title', 'custom_field_display_below_title', 2 );
function custom_field_display_below_title(){
    global $product;

    // Get the custom field value
    $custom_field = the_field( 'start_date' ); 
 
    // Display
    if( ! empty($custom_field) ){
        echo '

'.$custom_field.'

'; } }