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

https://wordpress.org/plugins/php-code-widget/


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -