Skip to content

Instantly share code, notes, and snippets.

@colorful-tones
Created July 29, 2024 15:00
Show Gist options
  • Save colorful-tones/5a5704374cbd5af591fc62373e6878cc to your computer and use it in GitHub Desktop.
Save colorful-tones/5a5704374cbd5af591fc62373e6878cc to your computer and use it in GitHub Desktop.
{
"name": "acf/car-details-condensed",
"title": "Car Details condensed (ACF Block)",
"description": "Display car details in a query loop.",
"category": "demo-acf-blocks",
"icon": "car",
"acf": {
"mode": "preview",
"renderTemplate": "template.php"
},
"style": ["file:./style.css"]
}
<?php
// Number field.
$mileage = get_field( 'demo_vehicle_mileage', $post_id );
?>
<?php if ( $mileage ) : ?>
<p><?php echo esc_html( $mileage ); ?> miles</p>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment