Last active
September 18, 2015 11:36
-
-
Save developer-anuragsingh/b0be49fb83ff76f3218b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('widget_text','execute_php',100); | |
function execute_php($html){ | |
if(strpos($html,"<"."?php")!==false){ | |
ob_start(); | |
eval("?".">".$html); | |
$html=ob_get_contents(); | |
ob_end_clean(); | |
} | |
return $html; | |
} | |
// Then call the image in text widget like, <img src="<?php echo get_bloginfo('stylesheet_directory');?>/image_folder_name/image_name.png"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment