using PHP code into WordPress widget

Sometime we need to insert PHP code into WordPress text widget but by default, WordPress ignore PHP code into widget. People use plugin for getting this but we can achieve it by using below given code into theme’s function.php.

using-php-code-into-wordpress-widget

PHP code into Wordpress widget

Now whenever you use text widget into your site, you can use PHP code. If you want current date to display just use into your widget like this

Using PHP code into WordPress widget is very simple.

You Might Interested In

Leave a Reply

Enclose a code block like: <pre><code>Your Code Snippet</code></pre>.