Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress Customizing the WordPress Admin Area Admin Color Schemes Customizing Admin Color Schemes from Scratch

Stavros Sofroniadis
PLUS
Stavros Sofroniadis
Courses Plus Student 1,503 Points

Difference betwwen Theme & Child Theme?

If you could mention what is difference betwwen Theme & Child Theme?

Why he is using a Child Theme instead of Theme?

In which case do we prefer to use Child Theme instead of Theme & vice versa?

Themes and Child Themes display the same web site, just Themes have more additional files than Child Themes? for intance if out theme is Portofolio then child theme will be Portofolio child? Are the same theme but child theme have less fies..

Please if you could clarify,

Thank You,

Luis Felipe Lino
seal-mask
.a{fill-rule:evenodd;}techdegree
Luis Felipe Lino
Full Stack JavaScript Techdegree Student 15,708 Points

Let me try to help you.

Child Theme usually is a theme that we use to edit the main theme in our own way. For example: If you buy a WordPress theme in a marketplace and edit it directly when this theme receives any update your code will be overridden.

The child theme will use every feature from the main theme plus the features you add to it.

Normally the child theme has fewer files because you will add just the files necessary to make child theme works and the files with additional features, but if you don't change anything, the child theme will look the same as the main theme.

Well, I don't know if this helps you out but I hope so. Good Luck.

Stavros Sofroniadis
Stavros Sofroniadis
Courses Plus Student 1,503 Points

When you mean to edit a theme, is to change the code of various html,css,php files included into the theme? So when you receive an update our code will override the update.

When you mention that child theme uses every feature of the main theme plus the featuress that we add, means that we can create new html,css,php files and include these into the theme folder or if we install and active various plugins is considered a change?

When download a purchased theme, we delete some files and keep only the necessary theme files in order to operate the theme. Dont know what are necessary files generaly in any theme. If you could mention some basic files needed , eventhough it depends from theme to theme

It is possible to send you a theme to mention important files of the theme?

In nutshel: In order a theme to be considered a child must: 1)Have only the important files in order to operate 2)Have change the code of onee or more html,css,php files 3)Have add one or more our html,css,php files or install/activate new plugins

Please mention, correct id disaggre of the previous and 1,2,3

Thank You,

2 Answers

Luis Felipe Lino
seal-mask
.a{fill-rule:evenodd;}techdegree
Luis Felipe Lino
Full Stack JavaScript Techdegree Student 15,708 Points

When you mean to edit a theme, is to change the code of various html,css,php files included into the theme? So when you receive an update our code will override the update.

Yes. You can edit almost everything in a theme, HTML, CSS, JS and PHP files. There are rules and good practices to do this, but you can change almost everything

If you don't have a child theme when the creators make available updates to the main theme, this update will override the changes that you have made. So your custom code will be overriden.

When you mention that child theme uses every feature of the main theme plus the featuress that we add, means that we can create new html,css,php files and include these into the theme folder or if we install and active various plugins is considered a change?

Means that we can create new HTML, CSS and PHP files, new pages, landing pages for specific purposes and different designs.

When download a purchased theme, we delete some files and keep only the necessary theme files in order to operate the theme. Dont know what are necessary files generaly in any theme. If you could mention some basic files needed , eventhough it depends from theme to theme

I use to keep all files and just disable or uninstal plugins that I won't use. In this link Zac Gordon explains about the basic files needed to make a theme works: https://teamtreehouse.com/library/the-wordpress-template-hierarchy

There is much more than this and you can learn a little bit more here: https://developer.wordpress.org/themes/basics/template-hierarchy/ and here http://wphierarchy.com/ but take your time dont rush.

It is possible to send you a theme to mention important files of the theme?

Yes. No problem. How do you wanna do this?

In nutshel: In order a theme to be considered a child must: 1)Have only the important files in order to operate 2)Have change the code of one or more html,css,php files 3)Have add one or more our html,css,php files or install/activate new plugins

Not exactly. To do a child theme you just need to create and setup the folders where the child theme lives, but you just need to do this if you have a good reason like make signifcant changes into the theme. Here is a link that explain a lot about how you can make a child theme and for what reasons: https://www.smashingmagazine.com/2016/01/create-customize-wordpress-child-theme/

If you need anything else let me know.

Stavros Sofroniadis
PLUS
Stavros Sofroniadis
Courses Plus Student 1,503 Points

1)If you made any changes in the code of theme when updated everything you changed will be lost due updateds, while if you change the code to child theme there is no danger due to updates?

2)child chemes can be updated without losing changes you made to the code in some files?

3) In the link you mentioned https://www.smashingmagazine.com/2016/01/create-customize-wordpress-child-theme/ says

"Yet, while any such theme can be a parent theme, some are better suited to this purpose than others. For example, frameworks such as Genesis by StudioPress are specifically made to be customized by child themes." When talk about frameworks means "themes" ?

4) About child theme, document link is understandable. Only needs only a folfer usually with same name - child (as parent) - ex: twenty fifteen -child and 2 files(css,php) https://www.smashingmagazine.com/2016/01/create-customize-wordpress-child-theme/ Useful info

Regarding php file(functions.php) dont understand exactly the code:

add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' );

function enqueue_parent_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' ); }

In the beginig we call function enqueue_parent_styles and the rest: add_action( 'wp_enqueue_scripts', not understandable

we have the body of a function called enqueue_parent_styles(without parameters) that calls another function named wp_enqueue_style that has 2 parameters:a) parent-style b)get_template_directory_uri().'/style.css parent-style is constant or what else? with b)we import parent css stylesheet into child theme?

5) in document mentioning how to create child theme, says under the title: IMPLEMENTING CUSTOM STYLES to open firebug and search for the following code

.entry-header { padding: 0 10%; }

.entry-title, .widecolumn h2 { font-size: 3.9rem; line-height: 1.2308; margin-bottom: 1.2308em; }

.entry-content, .entry-summary { padding: 0 10% 10%; }

have opened firebug and paste name of each selector but dint show nothing, maybe css file is empty... a)you can view code from imported parent theme css file(from firebug)? b)copy-paste the above code into style.css but h1 still didnt go up the photo as mentioed in an example. can send you the theme and child theme folder configurations via treehouse or any email to have a look? mention any email to send you the themes.

6)By adding some new code to threme child css file we use existimg css stylesheet of parent theme & we add some extra code?

7)About WORKING WITH TEMPLATE FILES have applied everything mentioned but woth no result. even the code

8) About USING FUNCTIONS.PHP even appeard a widget area in WordPress control panel didnt appear any widget in front end.

9)if you can mention your email to send you folder of child theme to have a look what is wrong, or through treeehouse if pssible,

excuse me for many questions,