=== Plugin Name === Contributors: Loomisoft Donate link: http://www.loomisoft.com/make-a-contribution/ Tags: content blocks, text blocks, reusable content, reuusable content widget, reusable text, reuusable text widget, WPBakery, Visual Composer, Fusion Builder, Beaver Builder, SiteOrigin Page Builder, page builder, pagebuilder Requires at least: 3.0.1 Tested up to: 4.7.1 Stable tag: 1.0.7 License: GPLv3 or later License URI: https://www.gnu.org/licenses/gpl.html This plugin allows users to define modular blocks of text/content and place them in pages, posts, sidebars, etc. via shortcodes, widgets or PHP. == Description == Loomisoft's Reusable Content & Text Blocks plugin allows you to define modular and repeated blocks of text and other content and place them within pages, posts, sidebars, widgetised areas or anywhere on your site via shortcodes, via the provided widget or via PHP. The idea behind this plugin is two-fold. The first is to modularise content so you can use the same content in multiple pages, posts and other places. The second is to provide an easy way to add complex custom content within sidebars and widgets. This latest version also supports WPBakery's Visual Composer, Avada's Fusion Builder, Beaver Builder and SiteOrigin Page Builder. = Features = * Uses WordPress custom post type and custom post management to define reusable content blocks * Allows the use of shortcodes, widgets and PHP to place content blocks into pages, posts, sidebars, widgetised areas or anywhere on your site * Provides a widget to place content blocks into sidebars and other widgetised areas * Supports WPBakery's Visual Composer, Avada's Fusion Builder, Beaver Builder and SiteOrigin Page Builder * Provides a number of other useful shortcodes to place dynamic text (e.g. date/time, site title, page title) into posts = Defining content/text blocks = Content or text blocks can be added and managed via the custom "Content Blocks" post type. Once defined, they can be used in your posts, pages and other areas in your site. = Shortcodes = Content blocks can be added to your pages, posts or anywhere in your site that accepts shortcodes by using the content block's post ID or slug using the following format: > [ls_content_block id="*<ID>*"] > [ls_content_block slug="*<SLUG>*"] You can also have the normal WordPress paragraphs added automatically by having: > [ls_content_block id="*<ID>*" para="yes"] > [ls_content_block slug="*<SLUG>*" para="yes"] = Widgets = A custom widget is provided so you can easily add content blocks to your sidebars and other widgetised areas. = Access via PHP = Content blocks can be added to your customised theme pages via PHP using the following code: > <?php echo ls_content_block_by_id( *<ID>* ); ?> > <?php echo ls_content_block_by_slug( '*<SLUG>*' ); ?> To have the normal WordPress paragraphs added automatically, use: > <?php echo ls_content_block_by_id( *<ID>*, true ); ?> > <?php echo ls_content_block_by_slug( '*<SLUG>*', true ); ?> = Use of Visual Page Builders = This latest version supports WPBakery's Visual Composer, Avada's Fusion Builder, Beaver Builder, SiteOrigin Page Builder and possibly others (although others have not been tested). To use this feature, you will need to: * If relevant to the specific page builder, enable the "lscontentblock" or "Content Blocks" post type within its settings * For shortcodes, use the para="yes" attribute as described above * For the widget, tick the "Automatically add paragraphs" checkbox * In the case of PHP, set the second parameter to true = Content blocks within content blocks = If needed, content blocks can be used within other content blocks via shortcodes as described above. A safety feature has been written into this plugin to suppress circular references. = Other useful shortcodes = This plugin also provides the following useful shortcodes, which can be used within content blocks as well as other places such as pages/posts: **Date & time:** (Using the standard PHP date format strings - see http://php.net/manual/en/function.date.php) > [ls_content_block datetime="*<DATE/TIME FORMAT>*"] For example, the current date in dd/mm/yyyy format would be: > [ls_content_block datetime="d/m/Y"] **Site title:** (As set in WordPress admin area - Settings > General) > [ls_content_block info="site-title"] **Title of current page/post:** (Note that this is the raw title of the page/post and not the same as the title within the HTML <title> tag, which can be changed by SEO plugins) > [ls_content_block info="page-title"] == Installation == 1. Upload the plugin files to the '/wp-content/plugins/loomisoft-content-blocks' directory, or install the plugin through the WordPress plugins screen directly. 1. Activate the plugin through the 'Plugins' screen in WordPress 1. Full usage information may be found in Content Blocks > Usage & About == Frequently Asked Questions == = Are Content Blocks easy to add and edit? = Yes. Content Blocks add the "Content Blocks" custom post type and use the WordPress native editor. = Can Content Blocks be placed anywhere on a site = Content Blocks can be placed within post/page content, within sidebars, and other areas via shortcode, via widgets and via PHP. = Can Content Blocks be used in other Content Blocks? = Yes. The normal shortcode can be used. In fact, a safeguard function has been built into the plugin to avoid circular references (e.g. Content Block A referred to within content Block B and vice versa). = Can visual page builders be used to create Content Blocks? = This version has been updated to supports WPBakery's Visual Composer, Avada's Fusion Builder, Beaver Builder and SiteOrigin Page Builder. In principle, other page builders may also work. However, they have not been tested. If you come across others we have missed, please let us know. == Screenshots == 1. List of Content Blocks custom post type 1. Edit screen for Content Block 1. Access details listed for Content Block 1. Widget for placing Content Block into sidebars, widget bars == Changelog == = 1.0.2 = * Launch version = 1.0.3 = * Added ls_content_block_by_id and ls_content_block_by_slug PHP functions = 1.0.4 = * Fatal error bugfix = 1.0.4 = * Fatal error bugfix = 1.0.5 = * Updated to support visual page builders including WPBakery's Visual Composer, Avada's Fusion Builder, Beaver Builder and SiteOrigin Page Builder = 1.0.6 = * Bugfix with Beaver Builder integration = 1.0.7 = * Bugfix of broken code handling Visual Composer integration == Upgrade Notice == = 1.0.4 = Corrections and bugfixes = 1.0.5 = Updated to support visual page builders including WPBakery's Visual Composer, Avada's Fusion Builder, Beaver Builder and SiteOrigin Page Builder = 1.0.6 = Updated to fix issues with Beaver Builder integration = 1.0.7 = Corrected broken elements handling Visual Composer blocks