Global Content Blocks
[resolved] Block in widget (5 posts)

  1. Francesco Canovi
    Posted 2 years ago #

    Is it possible to put the content block shortcode in a widget?
    Thank you and best regards!


  2. benz1
    Plugin Author

    Posted 2 years ago #

    Sure, in a text widget just wrap the shortcode in the PHP function
    <?php echo gcb(x);?>
    where x is the content block ID.

    You may need to install a plugin that allows you to use php in widgets.

  3. Bike
    Posted 1 year ago #

    Could you add a widget with the plugin that accepts short codes? So no PHP-accepting widgets are needed?

  4. benz1
    Plugin Author

    Posted 1 year ago #

    Not exactly sure what you mean but you could try it and see if it works?

  5. v3r50r
    Posted 1 year ago #

    this could also be done by just using the shortcode itself in the text.
    Eg: [contentblock id=xx] inside a text widget. The text widget evaluates shortcodes. If you have another widget, then you need to make sure it evaluates shortcodes in its content processing function.

    If you provide an example, I could assist you further

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Global Content Blocks
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.