简体   繁体   English

它与wordpress博客的PHP和css有关

[英]It is related to PHP and css for wordpress blog

I have installed a complete blank theme with no CSS in my new wordpress blog. 我在我的新wordpress博客中安装了一个没有CSS的完整空白主题。 I have been trying to give it a background image but no success. 我一直试图给它一个背景图像,但没有成功。

I am working on blog's content. 我正在研究博客的内容。 Blog is very new. 博客很新。 So, until content is ready, I want just a background image to appear on my blog and have some text in the middle of the page. 因此,在内容准备好之前,我只想在我的博客上显示背景图像,并在页面中间放置一些文本。

I removed content from footer.php, I removed default post which you see when Wordpress is first involved. 我从footer.php中删除了内容,删除了Wordpress首次参与时看到的默认帖子。 I removed content in searchform. 我删除了searchform中的内容。 php too. PHP也是。 I want it all blank for sometime. 我希望它有时空白。 just want a BG image and some text that displays in the middle of my blog. 只想要一张BG图像和一些显示在我博客中间的文字。

I added this line in blank theme's style.css..its not working. 我在空白主题的style.css ..中添加了这一行。 ALso where do I add text so it displays in the centre? 那么我在哪里添加文本以便显示在中心?

body { background: url('http://mysite.com/wp-content/uploads/2012/03/myIMG.jpg')

Can some one please help me out here?? 有人可以帮帮我吗?

I do not know anything about PHP so I dont knwo where to add text. 我对PHP一无所知所以我不知道在哪里添加文本。 Please help me. 请帮我。 Which php whould I add text to? 哪个php我要添加文字? and also this background image isnt still working. 而且这个背景图片还没有工作。 I changed "background" to "background-image" now 我现在将“背景”改为“背景图像”

this is the only css file in my Wordpress blog as of now..I have been making changes in this only. 这是我现在的Wordpress博客中唯一的css文件。我一直在对此进行更改。

/*
Theme Name: BlankSlate
Theme URI: http://tidythemes.com/blankslate/
Description: BEFORE USING AND ESPECIALLY UPGRADING PLEASE READ: tidythemes.com/concept. The bare essentials of a WordPress theme, no visual CSS styles added. Perfect for those who would like to build their own theme from scratch or for clients if you're a developer or designer. This theme is clean, valid code, semi minified, no programmer comments, SEO-friendly and 100% open source. One custom menu and one widgetized sidebar to get you started. If you don't know CSS and would like to learn we've prepared: tidythemes.com/want-to-learn-css and please visit us in the forum for further help: tidythemes.com/forum - Thank You and Enjoy
Author: TidyThemes
Author URI: http://tidythemes.com/
Version: 2.0
Tags: custom-menu, featured-images, microformats, sticky-post, threaded-comments
License: GNU General Public License v2.0 | From TidyThemes: This theme is completely free and open source to use as you like for both personal and commercial projects without any limitations.
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
body { background-image: url('http://mysite.com/wp-content/uploads/2012/03/myIMG.jpg')  !important; no-repeat}
body { text-align: center !important;}
html{  margin-top:0px !important;}

html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{font-size:100%;font:inherit;padding:0;border:0;margin:0;vertical-align:baseline}
body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}table{border-collapse:collapse;border-spacing:0}
article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}


.sticky{}
.bypostauthor{}
.wp-caption{}
.wp-caption-text{}
.gallery-caption{}
.alignright{}
.alignleft{}
.aligncenter{}

As a quick fixing just apply important it should work. 作为一个快速修复只是应用重要它应该工作。 It will override existing background. 它将覆盖现有背景。 But make sure your path is correct. 但请确保您的路径正确无误。

body { 
    background: url('http://mysite.com/wp-content/uploads/2012/03/myIMG.jpg') !important;
    }

if you have the element, find the class name or its id name. 如果您有元素,请找到类名或其ID名称。 If you can't find it then overwrite it, just put this code in your css 如果你找不到它然后覆盖它,只需将此代码放在你的CSS中

.class_name{ margin-top: 0 !important}

If that doesn't work make sure that the css file that you use to insert the code is in the last order where you declared your other css file. 如果这不起作用,请确保用于插入代码的css文件是您声明其他css文件的最后一个顺序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM