Override file in parent theme

Presumably a common question, but I'm having some difficulty as it's my first time editing WordPress themes.

I'm trying to create child theme based on Zincious. This is all fine for CSS, but when it comes to editing HTML, it doesn't work. I have the same file name and path as the original. Any idea what could be going wrong? All I'm trying to do for now is comment out / delete a div.

Thanks very much.

Topic parent-theme child-theme Wordpress

Category Web


if it the functions file, the child theme is loaded in conjunction with it's parent, the child being loaded first.

If its the index.php file, you need to make sure your WordPress version greater than or equal to 3.0. Otherwise, your index.php file won't overwrite.

A lot of reworking of themes has happened, so make sure you check out the documentation on themes and more specifically child theme overrides.

https://developer.wordpress.org/themes/advanced-topics/child-themes/

Basically, to overwrite another file, simply make sure it has the same name. If your trying to overwrite a theme specific (ie. not WordPress default theme file) file, it won't work. You'll have to overwrite at he WordPress specific theme name and go from there.

For example, if you are trying to override page.php, just place a page.php file in your child theme directory.

If page.php includes or requires some specific file in some parent theme sub-directory, you'll have to override page.php and change the include location.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.