Mobile app version of vmapp.org
Login or Join
Samaraweera270

: Why isn't Twitter widget working? I have Twitter's own widget set to load on a website, which works just fine. However, on my WP-powered blog the script is included but not rendered. I call

@Samaraweera270

Posted in: #Twitter #Wordpress

I have Twitter's own widget set to load on a website, which works just fine.
However, on my WP-powered blog the script is included but not rendered. I call it inside an empty div like this:


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



But it appears in the page source as HTML (I'm putting '...' to save room):


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


In other words, the script is not being executed. Why is this?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Samaraweera270

1 Comments

Sorted by latest first Latest Oldest Best

 

@XinRu657

You cannot process Javascript with the PHP interpreter - the PHP interpreter will ignore anything which is not bound by <?php/?> and will simply return the include as part of the document you are serving.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme