Trouble showing images in other pages than Home (wordpress/html/css)

前端 未结 1 1555
囚心锁ツ
囚心锁ツ 2021-01-24 12:06

Hi I have a small website im doing for a customer and I have used a html/css-site and transferred it to wordpress by using blank theme. So far so good, have a look at energyshop

1条回答
  •  不知归路
    2021-01-24 12:24

    This is because you're using relative paths. When creating a WordPress theme and you want to load resources from your theme, you should use absolute paths. There are two template tags that make this easy for you: get_bloginfo() and bloginfo(). The first one returns the value, and the second one echoes the value(that you request via the first argument passed to the function).

    So in order to display an image, you should have:

    English.png
    

    This will always result in this(for your site):

    English.png
    

    So simply replace all wp-content/themes/blank with .

    0 讨论(0)
提交回复
热议问题