Why isn't Twitter widget functioning?

I have Twitter is very own widget readied to load on an internet site, which functions simply great. Nonetheless, on my WP - powered blog site the manuscript is consisted of yet not provided. I call it inside a vacant div similar to this:

<?php include $_SERVER['DOCUMENT_ROOT'].'/twtr-widget.html' ?>

But it shows up in the web page resource as HTML (I'm placing '...' to conserve area):

<script src="http://widgets.twimg.com/j/2/widget.js"></script> 
new TWTR.Widget({...

In various other words, the manuscript is not being implemented. Why is this?

2019-05-18 23:37:53
Source Share
Answers: 1

You can not refine Javascript with the PHP interpreter - the PHP interpreter will certainly overlook anything which is not bound by <?php/ ?> and also will merely return the include as component of the record you are offering.

2019-05-21 08:58:29