-1
我正尝试从我制作的HTML网站创建自定义WordPress主题。当我插入我的index.html
文件到index.php
文件的所有内容,并改变所有的脚本,链接,图像源与相应的PHP线CSS中的图像URL不能在自定义WordPress主题中工作
<?php echo get_bloginfo('template_directory'); ?>/
一切工作正常,包括JavaScript文件。但是当我将它分成单独的文件(header.php
,content.php
,footer.php
)并将其放回到一起时,除了通过我的.css
文件插入的图像URL之外,即使它在我将其剪切到单独文件之前仍然正常工作,所有作品都将起作用。
这就是我的index.php的样子。
<?php get_header(); ?>
<?php
if (have_posts()) : while (have_posts()) : the_post();
get_template_part('content', get_post_format());
endwhile; endif;
?>
<?php get_footer(); ?>