Download the PHP package mwdelaney/acf-flexible-content-blocks without Composer
On this page you can find all versions of the php package mwdelaney/acf-flexible-content-blocks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mwdelaney/acf-flexible-content-blocks
More information about mwdelaney/acf-flexible-content-blocks
Files in mwdelaney/acf-flexible-content-blocks
Package acf-flexible-content-blocks
Short Description A collection of useful, reusable flexible content blocks for content development in WordPress with ACF 5 Pro. Templates included and automatically loaded.
License MIT
Homepage https://github.com/MWDelaney/acf-flexible-content-blocks
Informations about the package acf-flexible-content-blocks
Advanced Custom Fields Flexible Content Blocks
NOTE: This plugin is very much a work in progress. It includes a small number of layouts now, and will include more as time allows.
A WordPress plugin that provides a collection of useful, reusable flexible content blocks for use with ACF Pro 5. Basic templates included and automatically loaded, can be optionally overridden at the theme level.
This plugin creates a Flexible Content Field below the content editor on Pages and automatically includes content entered there below the_content()
on page templates.
Also wraps the_content()
in some basic HTML to make it easy to differentiate from the added content blocks.
Requirements
- WordPress 4.5+
- Advanced Custom Fields Pro 5
Usage
By default all included layouts are available:
- Content
- Media (image, oembed, 'content', code)
- Content With Media
- Featured Content
- Slider
- Tabs
- Gallery
- Collapsibles
- Cards
- Post List
- Strap
Enable only some layouts
To remove layouts from the available list, declare theme support for only the layouts you wish to use: `
Change post type blocks appear on
By default content blocks are enabled for Pages, to define which post types blocks should be available on, declare theme support:
`
Templates
Basic templates for each layout are included. These templates are designed to be simple for styling via your theme. To override the included templates, copy the template(s) you wish to override from templates
to your theme in a sub-directory called fcb-templates
Base template wrapper
The layout base can be overridden on a per-block-type basis. When a block is rendered, the plugin will first look in your theme, and then in the plugin directory, for layout-base-[layout_name].php
(e.g. layout-base-content_with_media.php
) if a specific base doesn't exist, the plugin will load the layout-base.php
template.
Layout-specific template parts
Like the base template, each template part's file name can be appended with a layout name (like content_with_media
to override the template for that layout only. For example, [your-theme]/fcb-templates/blocks/parts/block-cta-content_with_media.php
will be loaded only for calls to action in the "Content with Media" layout.
Actions and filters
Several filters are available to alter the plugin's output.
Filter: fcb_bg_colors
Change or add to the available "theme" background colors for blocks
`
Filter: fcb_btn_colors
Change or add to the available button colors for block calls to action
`
Filter: fcb_set_block_htag
Set the tag that block titles are wrapped in. This defaults to <h2>
. First remove the existing filter and then add your own:
`
Filter: fcb_set_block_wrapper_classes
Set the classes applied to content block wrappers. This filter runs each time a block is rendered, so classes can be conditionally applied per-block.
`
Filter: fcb_set_block_classes
Set the classes applied to content blocks. This filter runs each time a block is rendered, so classes can be conditionally applied per-block.
`
Filter: fcb_set_block_wrapper_styles
Set the styles applied to content blocks. This filter runs each time a block is rendered, so styles can be conditionally applied per-block.
This filter isn't recommended for use --it's used by the plugin to apply background styles which are set in the block. Semantic styles are always preferrable to style attributes applied per block.
`
Filter: fcb_content_before
This plugin armors the main WordPress content (the_content()
), by default. This filter can be used to modify the armor and output of the_content()
.
`
Filter: fcb_content_after
This plugin armors the main WordPress content (the_content()
), by default. This filter can be used to modify the armor and output of the_content()
.
`
Filter: fcb_get_layouts
Change the PHP class that the plugin looks at for layouts. See Adding Your Own Layouts.
Adding Your Own Layouts
You can append your own layouts to the included set using a filter:
`