WordPress.org

Ready to get started?Download WordPress

Forums

Global Content Blocks
[resolved] I can't get the content block to work in a widget (7 posts)

  1. jvknight
    Member
    Posted 1 year ago #

    I'm quite sure I'm doing something wrong (since I have NO php experience) and I can't seem to get the right combination of things put together to get the shortcode to work in a widget. I have added the code lines I found to functions.php and am still not getting things right.

    Help! Please. Thank you!

    Many blessings

    http://wordpress.org/extend/plugins/global-content-blocks/

  2. benz1
    Member
    Plugin Author

    Posted 1 year ago #

    Hi jvknight, I'm not sure why you would need to do anything in functions.php to get this to work? All you need to do is wrap the shortcode in a in the PHP function, see http://wpxpert.com/using-content-blocks-in-themes-widgets.

  3. benz1
    Member
    Plugin Author

    Posted 1 year ago #

    removed

  4. jvknight
    Member
    Posted 1 year ago #

    I thought I had tried that, tho with my inexperience with php code, maybe I put things together incorrectly. When you say "wrap the shortcode in the PHP function", what I did in the sample was replace the "x" with the shortcode # (in this case a "4') ... is that incorrect? I know shortcodes work in the widget out of the box for the theme (I tested that).

  5. benz1
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, that is correct but you'll have to install a plugin such as http://wordpress.org/extend/plugins/enhanced-text-widget/ that will let you use php in a widget.

  6. jvknight
    Member
    Posted 1 year ago #

    Hi Benz1...I'm using the ultimate tinymce widget and per it's write up I can use it to add php to the sidebar widgets. I'm going to try this again and see if I guoobered it up (yup, that's a techie term...smile)

  7. jvknight
    Member
    Posted 1 year ago #

    OK, it worked this time. Who knows what the heck I was doing...I was on a test site, so maybe one of the other things were causing an issue!+

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.