Newbie Question: can I change a theme's section without hard coding?

admin2025-06-02  0

Just started to try wordpress, not as easy as I thought it would be, maybe it is just that I am too used to Joomla?

Anyway, I was working on the default theme "Twenty Seventeen". It has a fullscreen picture at its landing screen, which is called "header media". For learning purpose, I want to change this section to a "custom html" just like in Joomla. But I couldn't find where to do this. So how do I do it? It seems to be something that is fixed in the theme and you can't change it without hardcoding PHP files, am I right?

Just started to try wordpress, not as easy as I thought it would be, maybe it is just that I am too used to Joomla?

Anyway, I was working on the default theme "Twenty Seventeen". It has a fullscreen picture at its landing screen, which is called "header media". For learning purpose, I want to change this section to a "custom html" just like in Joomla. But I couldn't find where to do this. So how do I do it? It seems to be something that is fixed in the theme and you can't change it without hardcoding PHP files, am I right?

Share Improve this question asked Mar 1, 2019 at 3:02 shenkwenshenkwen 1311 silver badge9 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

You can hard-code it to PHP file, but you don't have to edit the original theme files. Instead, you can create a child theme.

First, you create a folder and name it to your liking. For example my-theme Then create a style.css file inside that folder.

At the very top of that CSS file, you write this code:

/*
Theme Name: My Theme
Template: twentyseventeen
*/

Now you should be able to activate that theme from the administration area.

To override a theme file, you just need to create a file with the same name as the original one, inside your theme directory.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748852968a314263.html

最新回复(0)