AgilePress Content Block for ACF is a versatile tool developed by AgilePress that allows you to create dynamic HTML content with Advanced Custom Fields integration. It supports four powerful syntaxes for different ACF field types:
{field_name} for text, number, and other simple fields{group_name:sub_field_name} to access fields within ACF groups{{repeater_name}} HTML content with {sub_field} tags {{/repeater_name}} to loop through repeater fields and image galleries{{#if field}}...{{/if}} for conditional content display with support for = and != comparisonsThis block is perfect for:
The block provides an intuitive sidebar editor where you can write HTML and insert ACF field tags. On the frontend, these tags are automatically replaced with the actual values from your Advanced Custom Fields.
Requirements:
Example 1 – Simple field display:
<div class="location">
<p>Latitude: {latitude}</p>
<p>Longitude: {longitude}</p>
</div>
Example 2 – Group field access:
<div class="contact">
<h3>{contact_info:name}</h3>
<p>Email: <a href="mailto:{contact_info:email}">{contact_info:email}</a></p>
<p>Phone: {contact_info:phone}</p>
</div>
Example 3 – Repeater field loop:
<ul class="team-members">
{{team_member}}
<li>
<h4>{name}</h4>
<p>{position}</p>
<p>{bio}</p>
</li>
{{/team_member}}
</ul>
Example 4 – Gallery field loop:
<div class="gallery">
{{project_images}}
<figure>
<img src="{url}" alt="{alt}" width="{width}" height="{height}" />
<figcaption>{caption}</figcaption>
</figure>
{{/project_images}}
</div>
Example 5 – Conditional display:
<article class="post">
{{#if featured}}
<span class="badge">Featured</span>
{{/if}}
<h2>{title}</h2>
{{#if status = published}}
<p class="published-date">Published: {date}</p>
{{#elseif status = draft}}
<p class="draft-notice">This is a draft</p>
{{#else}}
<p class="pending-notice">Pending review</p>
{{/if}}
{{#if author_name != Anonymous}}
<p>By {author_name}</p>
{{/if}}
</article>
Example 6 – Complex combination:
<article class="project">
<header>
{{#if is_featured}}
<span class="featured-badge">Featured Project</span>
{{/if}}
<h2>{project_title}</h2>
<p class="meta">
Location: {location:city}, {location:country}<br>
Date: {project_date}
</p>
</header>
<div class="gallery">
{{project_gallery}}
<figure>
<img src="{url}" alt="{alt}" loading="lazy" />
<figcaption>{caption}</figcaption>
</figure>
{{/project_gallery}}
</div>
{{#if features}}
<div class="features">
<h3>Project Features</h3>
<ul>
{{features}}
<li>
<strong>{feature_name}:</strong> {feature_value}
</li>
{{/features}}
</ul>
</div>
{{/if}}
<footer>
{{#if client_type = commercial}}
<p><strong>Commercial Project</strong></p>
{{/if}}
<p>Client: {client_info:company_name}</p>
{{#if client_info:email != none}}
<p>Contact: {client_info:email}</p>
{{/if}}
</footer>
</article><h3>Additional Information</h3>
Security:
All field values are properly escaped using WordPress security functions (esc_html(), esc_url(), wp_kses_post()) to prevent XSS attacks and ensure safe output.
Performance:
The block uses WordPress native functions and ACF’s optimized field retrieval methods. Field values are processed server-side during render, ensuring optimal frontend performance.
Compatibility:
Developer Notes:
The block follows WordPress coding standards and uses