WordPress.org

Ready to get started?Download WordPress

Forums

Adding PHP to widgets (4 posts)

  1. carmen101
    Member
    Posted 7 years ago #

    I've downloaded a plugin that requires that to my template, I add the code <? if (function_exists('chicklet_creator')) { chicklet_creator(); } ?>

    I'd prefer not to add it to my template. Is there not a way to add this to a widget and then just drag and drop the widget to where I want this code to appear.

    I did try it but when I view my site, the plugin information did not display anything on my website.

    Thank you for your help.

    Carmen

  2. carmen101
    Member
    Posted 7 years ago #

    forgot to mention above, I added the above code to a text widget.

  3. drmike
    Member
    Posted 7 years ago #

    Why not just write a widget for it?

    http://automattic.com/code/widgets/plugins/

    Or fine a simple pre existing widget and modify it?

  4. MichaelH
    Member
    Posted 7 years ago #

    Otto's phpexec widget is pretty easy to use:
    http://ottodestruct.com/blog/2006/04/09/fun-with-widgets/

    If you are using 2.2, make sure you get his widgets.php fix that is listed in the comments of the post I linked above.

Topic Closed

This topic has been closed to new replies.

About this Topic