• I’ve been using a child theme to edit CSS on my blog but I’d like to edit the HTML as well.

    Specifically, what I want to do is replace the stock image of a computer monitor with my own image, and I want the image to change each time the page is refreshed (set it to choose from 5 different images or so).

    I hope I’m explaining this clearly. Here is a link to my blog:

    https://oxoxtali.com

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter oxoxTali

    (@oxoxtali)

    Thanks for your response, but I already read that page before starting with a child theme and I’m still totally confused… Does that mean I can’t edit HTML with a child theme? If not, how can I edit it?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Say this is your Parent Theme:
    – style.css
    – about.php

    And this is your Child Theme:
    – style.css

    To edit about.php’s code, all you need do is copy that file into your Child Theme.
    So your Child Theme is now:
    – style.css
    – about.php

    Now you can work on about.php within your Child Theme and change the code to your heart’s desires.

    Thread Starter oxoxTali

    (@oxoxtali)

    Thank you so much! I really appreciate the help.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    And Thank You for contributing to the open-source community.

    I have a question.

    The purpose of a child theme is so the parent theme can be updated for whatever reason, bugs/errors, security, etc.

    Maybe the about.php file isn’t all that critical. But let’s say you want to make changes to the header.php because you want to totally reconstruct the header div (what’s the point in using display:none; if you don’t even need the data being brought in). The file header.php contains some pretty important info like jQuery, etc.

    So lets say you edit header.php for whatever reason – and the theme author makes an update. I’m just going to ask the stupid question here… at that point I assume the person who created the child theme would have the responsibility to know that the parent theme had been updated and to check/compare any child theme files for edits?

    So you’d first want to try to make any changes (if possible) in the CSS and then modify any html, then any php. Eh?

    I’m just mostly talking out loud to wrap my head around child themes. I’ve never had a parent theme updated so I don’t know.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Is it possible to edit HTML in a child theme?’ is closed to new replies.