Skip to content
Advertisement

Tag: wordpress-featured-image

Function echos variable correctly to ajax file but in html doesn’t show anything

Php variable $testing correctly echos ajax file, but in html <?php echo $testing;?> doesn’t show anything. html: functions.php: Answer The solution is to add $(‘#featured-image’).html(data); to the script, which pass the data output to html. also moved php lines from html to function.php: I missunderstood how ajax works. The simplest answer imo is this diagram:

Advertisement