wordpress - PHP Code in Widget Not Working -
i have installed code in functions.php
function php_execute($html){ if(strpos($html,"<"."?php")!==false){ ob_start(); eval("?".">".$html); $html=ob_get_contents(); ob_end_clean(); } return $html; } add_filter('widget_text','php_execute',100);
i have logic code in widget area.
<?php if (is_front_page()) { ?> website designed , developed <a href="https://www.akvitek.com.au/">akvitek</a> <?php } else { ?> website designed , developed akvitek. <?php } ?>
i trying use widget in footer.
the output shows both text appearing side side on pages.
what doing wrong here!
please help.
just install plugin allow u add php code in widget
Comments
Post a Comment