脚本宝典收集整理的这篇文章主要介绍了php在js-file WordPress中,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
这个想法是这样的:
VAR bLOGTemplateDir = "<?PHP bloginfo('template_directory');?>";
<?PHP //Let's set the header straight header('Content-tyPE: text/javascript'); //Get the WP-specifics,so that we can use constants and what not $home_dir = PReg_replace('^wp-content/plugins/[a-z0-9\-/]+^','',getcwd()); include($home_dir . 'wp-load.PHP'); ?>
这可以确保您将定义添加到JavaScript文件中,并且您也可以将上面的示例与主题一起使用(只需确保将/ plugins更改为/ themes).
以上是脚本宝典为你收集整理的php在js-file WordPress中全部内容,希望文章能够帮你解决php在js-file WordPress中所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。