[WordPress] 外掛分享: AgilePress Content Block for ACF

首頁外掛目錄 › AgilePress Content Block for ACF
WordPress 外掛 AgilePress Content Block for ACF 的封面圖片
全新外掛
安裝啟用
尚無評分
58 天前
最後更新
0%
問題解決
WordPress 6.1+ PHP 7.0+ v1.1.0 上架:2025-12-11

內容簡介

總結:AgilePress Content Block for ACF 是在您的網站上顯示 Advanced Custom Fields (ACF) 數據最簡單的方式,無需編寫 PHP 代碼。該外掛橋接了 ACF 和區塊編輯器之間的差距,讓您可以直接在編輯器中使用自定義 HTML 模板呈現字段值、循環運行重複項目,以及顯示圖片庫。

問題與答案:
1. 提供了 AgilePress Content Block for ACF 的主要特點是什麼?
- 在網頁前端顯示 ACF 數據,使用 {field_name} 渲染任何自定義字段值。
- 無需編寫程式碼,停止編輯主題文件,可以在區塊內建立模板。
- 支持 ACF 重複器:使用簡單標籤輕鬆循環遍歷重複項目。
- 可以存取群組和嵌套字段,像 {group:subfield} 這樣存取複雜的數據結構。
- 具有動態 HTML,可以對 HTML 結構和 CSS 類進行完全控制。

2. AgilePress Content Block for ACF 支持哪些語法?
- 簡單字段:{field_name}(文字、數字、電子郵件等)。
- 群組字段:{group_name:sub_field_name}。
- 重複器和圖庫:{{repeater_name}} content {{/repeater_name}}。

3. 使用 AgilePress Content Block for ACF 需要符合什麼要求?
- 需要安裝並啟用 Advanced Custom Fields(免費或 PRO 版本)。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.1.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「AgilePress Content Block for ACF」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

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:

Simple fields: Use {field_name} for text, number, and other simple fields
Group fields: Use {group_name:sub_field_name} to access fields within ACF groups
Repeaters & Galleries: Use {{repeater_name}} HTML content with {sub_field} tags {{/repeater_name}} to loop through repeater fields and image galleries
Conditionals: Use {{#if field}}...{{/if}} for conditional content display with support for = and != comparisons

This block is perfect for:

Displaying custom field data in formatted HTML
Creating dynamic templates with ACF fields
Building complex layouts that pull data from custom fields
Looping through repeater fields and image galleries
Accessing nested group field data
Showing/hiding content based on field values
Integrating ACF data seamlessly into your content

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:

Advanced Custom Fields (free or PRO version)
WordPress 6.1 or higher
PHP 7.0 or higher

Usage Examples
Example 1 – Simple field display:

Latitude: {latitude}

Longitude: {longitude}

Example 2 – Group field access:

{contact_info:name}

Email: {contact_info:email}

Phone: {contact_info:phone}

Example 3 – Repeater field loop:

    {{team_member}}

  • {name}

    {position}

    {bio}

  • {{/team_member}}

Example 4 – Gallery field loop:

Example 5 – Conditional display:

{{#if featured}}
Featured
{{/if}}

{title}

{{#if status = published}}

Published: {date}

{{#elseif status = draft}}

This is a draft

{{#else}}

Pending review

{{/if}}

{{#if author_name != Anonymous}}

By {author_name}

{{/if}}

Example 6 – Complex combination:

{{#if is_featured}}
Featured Project
{{/if}}

{project_title}

Location: {location:city}, {location:country}
Date: {project_date}

{{#if features}}

Project Features

    {{features}}

  • {feature_name}: {feature_value}
  • {{/features}}

{{/if}}

{{#if client_type = commercial}}

Commercial Project

{{/if}}

Client: {client_info:company_name}

{{#if client_info:email != none}}

Contact: {client_info:email}

{{/if}}

Additional Information

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:

WordPress 6.1+ (tested up to 6.9)
PHP 7.0+ (tested up to 8.3)
ACF free version 5.0+
ACF PRO 5.0+
Classic and Block themes

Developer Notes:
The block follows WordPress coding standards and uses

延伸相關外掛

文章
Filter
Apply Filters
Mastodon