admin管理员组文章数量:1315247
I'm learning Wordpress from the book Wordpress for Dummies. The author says to open the theme editor then use the style.css sheet. I uploaded the image to the twentyseventeen image folder via FileZilla. She gives this example to add a new background image and change the color to white:
background #FFFFFF
url('images/newbackground.gif');
then she gives other property examples like
background-repeat: repeat-y;
I wasn't able to change the image using the code the author gave. Where to I have to place this code and how to make this change.
I've used the following code in the footer.php template to add category archives to the homepage:
<?php wp_list_categories(array(
'style' => 'none',
'orderby' => 'name',
'show_count' => true,
'hierarchical' => true,
'depth' => 1
)); ?>
So I know how to add code but I don't know how to add the examples she gave for the background image.
I'm learning Wordpress from the book Wordpress for Dummies. The author says to open the theme editor then use the style.css sheet. I uploaded the image to the twentyseventeen image folder via FileZilla. She gives this example to add a new background image and change the color to white:
background #FFFFFF
url('images/newbackground.gif');
then she gives other property examples like
background-repeat: repeat-y;
I wasn't able to change the image using the code the author gave. Where to I have to place this code and how to make this change.
I've used the following code in the footer.php template to add category archives to the homepage:
<?php wp_list_categories(array(
'style' => 'none',
'orderby' => 'name',
'show_count' => true,
'hierarchical' => true,
'depth' => 1
)); ?>
So I know how to add code but I don't know how to add the examples she gave for the background image.
Share Improve this question edited Nov 19, 2020 at 9:48 Rup 4,4004 gold badges29 silver badges29 bronze badges asked Nov 19, 2020 at 5:46 Roger WilliamsRoger Williams 113 bronze badges1 Answer
Reset to default 1Giving the CSS of
background #FFFFFF url('images/newbackground.gif');
is just giving an example based on basic CSS. Be careful when copying the suggestions made in the book because you missed an important colon after background
. It should be
background: #FFFFFF url('images/newbackground.gif');
Also, you need to make sure the URL part of the CSS is correct for the file you uploaded.
One suggestion can be that while you can do as suggested by the author of your book, it may be more beneficial (and more intuitive) to use the Media Library facility within WordPress rather than uploading directly into the twentyseventeen image folder using FileZilla or other FTP program.
This way you can link to the file using the information provided within the Media Library regarding the image you wish to use.
Take for example the following image in the WordPress Media Library of a website I maintain.
If you look to the bottom right of the screenshot, you will see the image file's URL and a Copy URL button so the Media Library helps you by providing the information for the url('images/newbackground.gif')
part of the CSS. In this case it would be url('/wp-content/uploads/2019/05/articles-cover.jpg')
as you don't need to include the domain part of the URL.
本文标签: cssHow can I upload an image for background use using the Theme Editor in Wordpress
版权声明:本文标题:css - How can I upload an image for background use using the Theme Editor in Wordpress? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741982175a2408463.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论