WordPress.org

Ready to get started?Download WordPress

Forums

Is it possible to edit HTML in a child theme? (8 posts)

  1. oxoxTali
    Member
    Posted 1 year ago #

    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:

    http://oxoxtali.com

  2. tomontoast
    Member
    Posted 1 year ago #

  3. oxoxTali
    Member
    Posted 1 year ago #

    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?

  4. Andrew
    Forum Moderator
    Posted 1 year ago #

    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.

  5. oxoxTali
    Member
    Posted 1 year ago #

    Thank you so much! I really appreciate the help.

  6. Andrew
    Forum Moderator
    Posted 1 year ago #

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

  7. AardvarkGirl
    Member
    Posted 1 year ago #

    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.

  8. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    @AardvarkGirl - please start a new thread per http://codex.wordpress.org/Forum_Welcome#Where_To_Post

Topic Closed

This topic has been closed to new replies.

About this Topic