The Content Blocks plugin enables you to display the contents of a specific custom post in a widget or in the content area using a shortcode.
This plugin offers significant advantages over the default WordPress text widget, including the ability to use the WYSIWYG editor for content editing and image addition. It allows non-administrator accounts to modify widget content, making it more accessible.
Additionally, the plugin supports featured images and is compatible with the WPML Multi-Language plugin, ensuring the correct language is displayed in the widget area. Content Blocks can also be included in posts and pages using built-in shortcode functionality.
The plugin creates a 'content_block' custom post type, which can be configured to display titles and descriptions in the widget context. To add content, simply drag it to the desired sidebar position and select the custom post title in the widget configuration.
Other Notable Features
Here are a few other notable features of this free
Content Blocks (Custom Post Widget) plugin.
Content Block
Custom Post
Widget
Screenshots
FAQ
Of course you can always use the default text widget, but if you prefer to use the WYSIWYG editor or if you have multiple editors and you don’t want to give them administrator rights, it is recommended to use this plugin.
It is recommended to install the Widget Logic plugin, this will give you complete flexibility on widget placement.
This plugin has built-in support for the featured image functionality on the edit screen. Note that featured image will not be resized, so you will have to make sure it is the right size when uploading or restrict the image size via the stylesheet.
If your social media sharing plugin adds buttons to the widget areas you could check the ‘Do not apply content filters’ checkbox. Note that when this is done, WordPress will also stop adding paragraph tags to your text, so use this setting with caution. It is much better to ask the developer of the social media sharing buttons plugin to correctly use the content filters (see http://pippinsplugins.com/playing-nice-with-the-content-filter/ for more information on this). If you are embedding your content block with the shortcode, add the following: suppress_content_filters="yes"
Currently the shortcode function only outputs the post content and title of the content block, future support for displaying the attached featured image is being considered.
Yes, you can create your own template for the content blocks, you can do so by adding a file named custom-post-widget.php to your theme folder. More information about this can be found in this support topic
In these Gists you can find examples of templates for shortcodes and for widgets
Please post your feature request on the support forum These new features are on the to-do list:
Display the content block featured image when using the shortcode
Front-end editing of the content blocks
Visual Composer integration
Show the shortcode on the “View all Content Blocks” list view
You can create your own widget template and upload this to your theme folder. See this support topic for more information about this feature.
You can make the post type public by adding the following code to your theme’s functions.php file: function filter_content_block_init() { $content_block_public = true; return $content_block_public; } add_filter(‘content_block_post_type’,’filter_content_block_init’);
Yes, v2.6 now gives you the option to use the content block’s url slug in the shortcode. Use the following syntax for doing this: [content_block slug=my-content-block]. Note that if you ever change the slug of a content block, the embedding no longer works. Therefore I recommend using the post ID instead (which never changes).
By default the shortcode adds a div around the content block with the class content_block. If you like, you can change this class by adding it to the shortcode: [content_block id=198 slug=our-wordpress-plugins class=my-class]
You can use the do_shortcode function for this: echo do_shortcode('[content_block id= ]');
See https://codex.wordpress.org/Function_Reference/do_shortcode for more information on this function.
Please create a support topic in the forum: https://wordpress.org/support/plugin/custom-post-widget
Creating and supporting this plugin takes up a lot of my free time, therefore I would highly appreciate it if you could take a couple of minutes to write a review. This will help other WordPress users to start using this plugin and keep me motivated to maintain and support it. Also, if you have a twitter, Facebook or Google+ account, it would be fantastic if you could share the link to this plugin!
Contributors and developers
“Content Blocks (Custom Post Widget)”
is open source software. The following people have
contributed to this plugin.