在wordpress中修改主题时,当我想删除主题内容时,最好删除CSS或PHP或BOTH

I am doing my website, with studiopress genesis framework and their theme child, now i want to remove some unneccesary header content. So I know which code to remove from CSS and which from PHP, is it enought if I only remove CSS and leave PHP, and vice versa, or do I need to remove them both?

Thank you on help!

Because your goal is to REMOVE the content, you have to remove the PHP code with its HTML counterpart. In fact, it's irrelevant whether you remove the CSS or not. You might use that styling for something else.

Anders' solution will work well if your goal is to HIDE the content instead of removing it and as he said, you can later on put it back if you like.

If you are absolutely sure that you won't need to use that ever again (heck, you can just copy it back from the original theme) and that you also won't need to use the styling, then go ahead and remove both the CSS and the PHP/HTML to keep everything clean. I would personally do that since I like my code to be looking good :)

If you just remove the CSS you will not remove the content, just the formatting. However, you can hide content using CSS like this:

#id-of-element-you-want-to-remove {
    display: none;
}

The pro of removing content with CSS is that it is quick to do and easy to reverse if you should change your mind. The con is that the content is still constructed on the server and sent to the client, so you are wasting both your own resources and those of your visitors. However, if the content is minor this might be a minor thing.