• Since switching to a block theme, I can’t figure out how to get fields to display in a block under Twenty Twenty Four theme.

    My old custome theme with ACF it was straight forward. I put the following code in the relevant template:

           <?php 
    if (get_post_meta($post->ID, 'service_date', true)) {
    $service_date = get_post_meta($post->ID, 'service_date', true);
    // $currentDate = date('d/m/Y');
    echo '<span class="service-text">Service:</span>';
    echo ' ' . $service_date;
    }

    if (get_post_meta($post->ID, 'service_time', true)) {
    $service_time = get_post_meta($post->ID, 'service_time', true);
    echo ' - ' . $service_time;
    }

    ?>

    I can’t figure out how to do this under Twenty Twenty Four theme, and I can’t find a codex anywhere that explains how to do it. Any help would be appreciated.

  • You must be logged in to reply to this topic.