How to extract data from database in Home page wordpress with ajax?
<p>I want to call <code>/home/***/public_html/subdomains/busuioc/wp-content/themes/scalia/json_gallery_data.php</code><br>
the content of <code>json_gallery_data.php</code> is:</p>

<pre><code>global $wpdb;
$programs = $wpdb-&gt;get_results("SELECT * FROM program_tv");
$tv=array();
foreach ( $programs as $program){
    $tv[]=$program-&gt;day;
}
echo json_encode($tv);
</code></pre>

<p>the ajax file is:<br></p>

<pre><code>jQuery(document).ready(function(){ 
     loadData();
});
var loadData=function(){
    jQuery.ajax({
        type:"POST",
        url: 'site.com/wp-content/themes/scalia/json_gallery_data.php'
    }).done(function(data){
        var videos=JSON.parse(data);
        for(var i in videos){
           alert(videos[i]);
        }
    });
</code></pre>

<p>};</p>