How To Add PHP Code into WordPress Widgets

I’ve change my blog template and quite satisfied with the combination between WordPress and a brand new BlogNews themes. BlogNews themes came with fully customization option, with flexible widget on every part of template layout. WordPress widget give me a simple way to add some content on the selected place.
One drawback with WordPress widgets is that we couldn’t add plugins or call PHP code within widgets. If you get same problem, the following plugins may help you to manage PHP code within widgets :

  1. PHP-Code-Widget
  2. PHP-Widgetify
  3. Daiko’s Text Widget

Install one of the above plugins (I choose the first choice) with WordPress plugins page, activate it and then voila, you have a new widget, the one like text widget but it can handle PHP code. Don’t forget to insert PHP code inside PHP tags (<? and ?>) if you wish to add PHP function. The widget should also supporting standard plain text and HTML code.

11 thoughts on “How To Add PHP Code into WordPress Widgets

  1. Is there a widget that will allow you to add add_shortcode tags in a widget? For example [CSSBUTTON target=”http://www.linktarget.com” color=”000000″ textcolor=”ffffff”]Button Caption[/CSSBUTTON] from the WP CSS Button plugin.

Comments are closed.