-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(); ?>