Last active
April 3, 2021 03:15
-
-
Save vielhuber/2ba1bac283c504e0f5f8 to your computer and use it in GitHub Desktop.
get Bloginfo baseurl in JavaScript File #js #php #wordpress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
var baseurl = '<?php echo get_bloginfo("url"); ?>'; | |
var tplurl = '<?php echo get_bloginfo("template_directory"); ?>'; | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alert(baseurl); | |
alert(tplurl); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment