Linux 软件免费装
Banner图

GB HTML Blocks for Advanced Custom Fields

开发者 gregbialowas
更新时间 2026年11月9日 15:27
捐献地址: 去捐款
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

blocks acf advanced custom fields flexible content page sections

下载

1.4.2

详情介绍:

Adds a ready-made "HTML blocks" Flexible Content field group to pages, posts and products and renders it on the front end. Full guide with screenshots and examples: https://gregbialowas.com/custom-html-blocks-acf-pro Two layouts inside the field: How to use
  1. Install and activate Advanced Custom Fields PRO, then this plugin.
  2. Edit a page (or a post). Under the title you will find the "Flex Blocks" field group. Click + New Page Section and choose a layout: Section Content (title, intro text and one or two columns) or Hero Image/Video (an image or a looped video, optionally edge-to-edge).
  3. Fill in what you need. Empty fields are not printed. The Options row has custom CSS classes, "second column first" on mobile, 65/35 widths, reversed columns and "Remove top margin" (the section touches the previous one, so a few sections look like one block).
  4. To put an image inside the text, use Add Media, fill in Caption and choose the alignment: the text wraps around it and the caption sits below.
  5. Update the page. The sections are printed after the page content.
A longer guide with screenshots: https://gregbialowas.com/custom-html-blocks-acf-pro Style it your way (custom CSS) Every block has the ability to add its own CSS classes, so you can change the look of the content, the columns, the buttons and the images in your own theme, without touching the plugin. Type your own class in the Custom class(es) option of a section and style it in your theme's CSS. You can also override the CSS variables (see "CSS variables") or the classes of the plugin (see "CSS classes"). To use only your own styles, return false from the gb_html_blocks_enqueue_styles filter. You can also override the HTML itself with a template in your theme (see "Theme override").

安装:

  1. Upload the plugin to WordPress and activate it
  2. Edit a page: the "Flex Blocks" field group appears under the title
  3. The sections appear automatically after the page content. To place them yourself, turn the automatic output off with add_filter( 'gb_html_blocks_auto_output', '__return_false' ); and print them in your theme template:
<?php if ( function_exists( 'gb_html_blocks_render' ) ) { gb_html_blocks_render(); } ?> or use the shortcode [gb_html_blocks] (optional: post_id="123"; a shortcode in the content also stops the automatic output for that page).

屏幕截图:

  • **Section Content:** Add a section title, an optional intro text and the main content using the WordPress editor. Each section can be independently configured and displayed on the front end.
  • **Section and column options:** Customize the output with CSS classes, adjust column widths and order, reverse columns on desktop, change their order on mobile, or remove the top margin to connect consecutive sections.
  • **Two-column content:** Edit two independent columns, each with its own title, image, text and link.
  • **Front-end output:** Automatically rendered page sections, displaying the selected layout, content and configuration options.

常见问题:

Does it work with the free ACF?

No. The Flexible Content field is available only in ACF PRO. The plugin checks for the field type itself, so it shows an admin notice when the field is missing.

Where are the fields stored?

In the plugin, in acf-json/. If you edit the field group in the ACF admin, ACF saves the change to your theme's acf-json folder (if it exists), not to the plugin.

I already have this field group in my theme

The group key is group_64b23e42d861a. Remove the copy from the theme's acf-json folder, otherwise two files describe the same group.

更新日志:

1.4.2 1.4.1 1.4.0 1.3.0 1.2.4 1.2.3 1.2.2 1.2.1 1.2.0 1.1.2 1.1.1 1.1.0 1.0.0