Skip to content

Instantly share code, notes, and snippets.

@vielhuber
Last active April 3, 2021 03:15
Show Gist options
  • Save vielhuber/2ba1bac283c504e0f5f8 to your computer and use it in GitHub Desktop.
Save vielhuber/2ba1bac283c504e0f5f8 to your computer and use it in GitHub Desktop.
get Bloginfo baseurl in JavaScript File #js #php #wordpress
<script type="text/javascript">
var baseurl = '<?php echo get_bloginfo("url"); ?>';
var tplurl = '<?php echo get_bloginfo("template_directory"); ?>';
</script>
alert(baseurl);
alert(tplurl);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment