Not So Breaking News: Child Themes reduce Headaches

To say that my life has changed since learning about child themes would be an understatement. I’m glad that I now know the proper way to edit styles, functions, and PHP code, on the other hand i’m upset that I have not been editing themes correctly since I first learned about WordPress.

My clients have had the misfortune of not updating their themes as they become available because I did not want to lose my styling edits in .css files and edits to html and javascript in .php files. That is one huge mistake I plan on correcting with my Web Dev Project:

I chose a theme titled Big Bang because I really found it to be a great representation of what I was looking for; a responsive and clean theme that will allow me to display the cleaning company in the right light. I think the theme is simple enough that it should allow me to make styling adjustments and edits that I deem necessary. The theme already includes a custom post type for portfolio items. I plan on adding a few custom input boxes on the custom post type portfolio to consistently display information like # of bedrooms, and bathrooms.

After looking through the different .php files in the theme, I am noticing a few discrepancies between what the theme creators have named the .php files as compared to the template hierarchy diagrams Greg has outlined in the readings for this week. It makes it a bit difficult to interpret what is actually in the files but I think I have a good understanding by looking at the code inside the .php files. It’s unbelievable to be in this position after a few short weeks of this web development class. I’m now able to differentiate and narrow down on specific pieces of code and see how I can alter things. I have yet to find redundant code or badly written code in the template .php files, but i’m sure I’ll find a few as no piece of code is perfect.

The inspector tool continues to be my best friend as it allows me to focus on a specific piece of code. I cut the class or id of a < div > or < p > tag and paste it into the child theme style sheet and override whatever the current style is. It almost feels like i’m cheating, which is worrisome because the last time I felt comfortable, JavaScript stepped up to the plate. I’m really proud with the progress I’ve made so far in the class. It couldn’t have come at a better time because my Advil was running low.  I’m positive my classmates feel the same way.

1 thought on “Not So Breaking News: Child Themes reduce Headaches

  1. Luis Gonzalez Post author

    I attempted to edit the slider.php file on my theme by creating a file with the same name and included it in the child theme. I’m uncertain as to whether this was done correctly. I’m under the assumption that by including a .php file with the same name as the one on the parent theme that it overrides that .php file.

    It doesn’t operate the same way as the .css file where you can import the old stylesheet. Perhaps cutting and pasting the entire .php file and editing that would be the best route. I’m sure Greg will be more than happy to answer a few more questions on this topic. Did anyone else have a better way of creating and editing their themes through .pho files? I’d be more than happy to hear of best practices.

    P.S. JQuery library is immense and finding attributes takes a good amount of googling effort!


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.