<?php
// Get the current post's progress-to-goal meta value
$progress = get_post_meta(get_the_ID(), 'progress-to-goal', true);
// Ensure the progress value is numeric and clamp it between 0 and 100
$progress = is_numeric($progress) ? max(0, min(100, $progress)) : 0;
?>
<div class="progress-bar-container">
<div class="progress-bar" style="width: <?php echo $progress; ?>%;"></div>
</div>