PHP Widgets


PHP Widgets

Sometimes it may be necessary to run an advanced query in a widget area. Many, many WordPress plugins use a similar process to execute the functionality of the plugin.

Note:
This is a very advanced feature. Used maliciously; it could cause damage to your website.
It is HIGHLY recommended you trust all users who have access to the admin widget area before enabling this option.

Visit the plugin settings page -> General tab. Click the checkbox to enable “PHP Widgets”.

php_widgets1

This will create a new widget on the admin Widgets page.

php_widgets2

Drag this new widget to any available widget area; and you can insert your normal text, html or php code.

php_widgets3

The PHP Widget will be processed when it is viewed from the front end of the website.

php_widgets4

Going Further

This is an extremely dumbed down example. PHP Widgets can be used for a vast number of additional features. Scripts can also be included in PHP Widgets. This means any snippets from Facebool, Twitter or any other online API can be used in PHP Widgets.

Let Us Know

We would love to hear what you have done with your PHP Widgets! Use the comment section below to share your experience.


Josh Lobe has written 53 articles

Josh Lobe is the sole developer of WP Edit and WP Edit Pro. A father of two; a husband to a beautiful wife; and a small home in the suburbs... he primarily enjoys coding in WordPress and designing websites.

Leave a Reply

Your email address will not be published. Required fields are marked *

ENTER CAPTCHA MATH *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>