I try run php script from external file on wordpress site.
Example:
jQuery:
jQuery('.button').click(function(){
jQuery(this).parent('.entry_card').append('<div class="static"></div>');
jQuery(this).parent('.entry_card').children('.static').load("insert.php");
});
insert.php:
<?php
echo date("d.m.Y h:i:s"); //for testing
echo the_title(); //wordpress post title
if( get_field('xxx') ) { insert_cform('1'); } //some order form
else { insert_cform('2'); }
?>
Date is inserted correctly, but rest of the script don't working. I'm noob in coding, sorry if my question is stupid.
the_title(), etc.