Reusable Content Blocks plugin allows you to insert content blocks (pages, posts, custom post types) created with your favorite page builders like WPBakery’s Page Builder, Elementor, Beaver Builder, SiteOrigin Page Builder, and Classic editor into contents, widget areas and templates using shortcode, Widget or PHP without missing custom/inline styles generated by page builders.
Features
- Works with WPBakery’s Page Builder, Elementor, Beaver Builder and SiteOrigin Page Builder.
- Works with WPBakery elements from the The7 theme.
- Dedicated element for WP Bakery page builder.
- Extendable support for other page builder addons and Elements from Themes.
- Allows using shortcodes, widgets and PHP function to place content blocks into other contents, widgetised areas or templates.
- Provides ready to use shortcodes and functions for Reusable block post types.
Usage cases
- Create Reusable blocks and insert it on multiple places, manage it from a single place.
- Design custom footer layouts using page builders, and insert it using Widget.
- Design a topbar like a block using page builder, place it in templates using PHP or hooks.
- Insert contents of page, post or custom post types in other contents using shortcode.
Function usage examples
Other than using shortcodes, WP bakery element and widgets, you can also place content blocks using functions. You just need to call the function <?php rcblock_by_id( "12" ); ?>
in your template where you want to didplay the block.
You can also place conditionally on some specific pages using WordPress Conditional tags.
<?php if ( !is_front_page() && !is_home() ) { rcblock_by_id( "12" ); } ?>
Using hooks
You can also place it using hooks if hooks available in the location you want to insert.
add_action( 'wp_footer', 'insert_events_banner' ); function insert_events_banner() { if( is_category( 'events' ) ) { rcblock_by_id( "52891" ); } }
add_action( 'presscore_after_content', 'insert_cp_banner' ); function insert_cp_banner() { rcblock_by_id( "52894" ); }
CSS Meta keys
Some page builders save element’s custom CSS as meta keys and render it when the page is viewed. If elements from your theme or page builder addons missing style when inserted with shortcode. In such case you can add CSS Meta Keys in your Dashboard > Reusable Bloks > Options > CSS Meta Keys filed.
By Default plugin already included the7_shortcodes_inline_css
– Meta key for The7 theme, CSS from WP Bakery page bulider, Elementor, Beaver bulider, Page builder by Siteorigin. Style from Ultimate addon for WP Bakery, the Massive addon will also work fine. You only need to bother about this if styles missing for custom Elements from your Theme, and other plugins.
How to find missing Meta keys.
Go to your phpmyadmin area and locate Postema table, search for the page ID you have created with page builder, and meta key simlar to css, plugin, theme name. SELECT * FROM `wp_postmeta` WHERE `post_id` = 52143 AND `meta_key` LIKE '%css%'
If you feel like its hard, you should better check with your Theme/Plugin developer for the meta key, or how they load custom/inline CSS.