关于PHP引入CSS、JS、图片等外部文件

如果你的页面有引用CSS、JS以及图片,例如:sample.css、sample.js、sample.jpg,可以将这些文件一并复制到主题目录下,然后引用地址改为:

<link href="<?php echo get_theme_file_uri( 'sample.css' ); ?>" rel="stylesheet" type="text/css" />
<script src="<?php echo get_theme_file_uri( 'sample.js' ); ?>" type="text/javascript"></script>
<img src="<?php echo get_theme_file_uri( 'sample.jpg' ); ?>" />