Working in Wordpress, I have a snippet of code that I want to share with my users:
<script type="text/javascript">
document.write('<div class="rslr1">Our Reviews');
new rssdisplayer("rslrdiv1", "http://mydomain.com/blogname/rss-feed/", 4, "description");
document.write('<a href="#">Add a Review</a></div>');
</script>
Again, I'm not running this code, I am sharing it between tags, ans escaping all the brackets.
The tricky bit here is that I want to replace 'blogname' in the third line of code with the actually blogname, which is a PHP variable.
I see lots of answers here about using a PHP variable in javascript, but I'm not running the script. I'm simply posting it in a blog post for my users to grad, and need to dynamically insert the blogname into the RSS feed URL.
Any help much appreciated.
Larry