Advanced Custom Fields
With ACF (free or Pro) active, Range Trust registers a Range Trust Widget field type: a dropdown of your saved widgets. It gives editors control over which review widget appears on a page without touching shortcodes.
The field type
Add a field, set its type to Range Trust Widget (under Relational), and choose the Return format:
- Widget ID:
get_field()returns the numeric id (default). - Rendered widget HTML:
get_field()returns the ready-to-print markup.
In templates
With the Widget ID format:
$widget_id = get_field( 'testimonials_widget' );
if ( $widget_id ) {
range_trust( (int) $widget_id );
}
With the Rendered widget HTML format:
echo get_field( 'testimonials_widget' ); // already-escaped widget markup
Combining with overrides (ID format only):
range_trust( (int) get_field( 'testimonials_widget' ), array( 'layout' => 'grid' ) );
Shortcodes in ACF fields
The usual WordPress rule applies: text fields don't run shortcodes unless you ask.
echo do_shortcode( get_field( 'free_text_area' ) );
Data for flexible layouts
For ACF-driven designs that need raw numbers rather than a whole widget, say a stat in a hero block, use the template tags:
$agg = range_trust_rating();
printf( 'Rated %.1f from %d reviews', $agg['rating'], $agg['count'] );