WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Global Content Blocks

Creates shortcodes to add HTML, PHP, forms, opt-ins, iframes, Adsense, code snippets, reusable objects, etc, to posts/pages and preserves formatting.

How big a content block can I add?

The content block will hold up to 64,000 characters.

Can I create content blocks with PHP code?

Yes, just copy the PHP as normal into a content block without the <?php, <?, ?> tags and insert the block into your content as normal.

Can I create content blocks using a visual editor?

Yes, the Settings page where the content blocks are created includes the standard WordPress visual/HTML editor.

How do I use a shortcode within a content block?

Simply add the shortcode within a block as normal, for example [gallery] to add a WordPress gallery.

Can I use content blocks outside of posts and pages?

Yes, just wrap it in the PHP function <?php echo gcb(x);?> where x is the content block ID. You can also use the longer form <?php do_shortcode("[contentblock id=x]");?>

Is it possible to modify the output of inserted content blocks?

Yes, you can add the filter 'gcb_block_output' to modify output by adding a PHP script to functions.php, for example:
add_filter('gcb_block_output', 'alter_block_output');
function alter_block_output($value) {
//process the output here, e.g., convert text to lowercase
$new_value = strtolower($value);
return "Processed output: ".$new_value;
}

Can I use variables?

Yes, You can use variables within the content block that will be replaced when the block is displayed. For example, if you create a content block, say id=1 with: My name is %%name%%
by using the shortcode [contentblock id=1 name="John Doe"] when displayed it will appear as My name is John Doe.

Can I use WordPress global variables?

Yes, WordPress global variables can be used within content blocks, for example, global $user_login;
global $user_email;
echo "$user_login, you email is: $user_email";
would output the username and email of the current logged in user, e.g., John, your email is john@youremail.com.

Will I lose my content blocks if I change the theme or upgrade WordPress?

No, the blocks are added to the WordPress database so are independent of the theme and unaffected by WordPress upgrades.

Can it be completely uninstalled?

Yes, there is an option to delete the database table if you want to completely remove the plugin.

Can I copy any content blocks I've created to another WordPress site?

Yes, an Import/Export function is included. Just Export form one site, install the plugin on the other site and import.

Requires: 2.8.6 or higher
Compatible up to: 4.0.0
Last Updated: 2014-9-20
Downloads: 55,061

Ratings

4.9 out of 5 stars

Support

8 of 15 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1
100,1,1
100,1,1
100,1,1
100,2,2
100,2,2
100,2,2
25,12,3 100,2,2 100,1,1
100,2,2 100,2,2 100,2,2 100,2,2
100,1,1
100,1,1 100,2,2 100,1,1 100,2,2 100,3,3
100,1,1
100,2,2
100,1,1
100,1,1 0,1,0
100,1,1
100,4,4 100,1,1 100,1,1
100,1,1 100,3,3 100,1,1
100,1,1 100,1,1
0,1,0 100,1,1 100,3,3 100,4,4
100,1,1 100,4,4
100,3,3
100,1,1 100,1,1 100,1,1 100,1,1
100,2,2
100,2,2
0,1,0
100,1,1
100,2,2
100,1,1
100,1,1
100,1,1