Child Theme Broken

Posted in: Newspaper
Post count: 19

Hi all,

I’m trying to add a Child Theme for Newspaper v8.7.5

This is my structure:

/Newspaper-child
functions.php
style.css

Here’s my functions file:

<?php
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles', 1001);
function theme_enqueue_styles() {
    wp_enqueue_style('td-theme', get_template_directory_uri() . '/style.css', '', TD_THEME_VERSION, 'all' );
    wp_enqueue_style('td-theme-child', get_stylesheet_directory_uri() . '/style.css', array('td-theme'), TD_THEME_VERSION . 'c', 'all' );
}
);

And my style.css

/*
Theme Name:     Newspaper 8 Child theme
Theme URI: 		http://themeforest.net/user/tagDiv/portfolio
Description:    Child theme made by tagDiv
Author:         tagDiv
Author URI: 	http://themeforest.net/user/tagDiv/portfolio
Template:       Newspaper
*/

When I try to activate the child theme, everything breaks. What am I doing wrong?

  • This topic was modified 8 years by altpress.
Post count: 20688

Hi,

To use the child theme he theme provides you simply have to upload it in the themes folder
https://forum.tagdiv.com/the-child-theme-support-tutorial/
Then you can activate it and there would be no problem.

I just tested this and it works properly. Usually problems with the child theme are created when the child theme is renamed, or the main theme is renamed. Or by code entered in the child theme. Or modifications to the default code found in the child theme functions or stylesheet files.

So upload the child theme – https://www.screencast.com/t/7IkAZtZrD
Activate it – https://www.screencast.com/t/6fqJNajtfX

Post count: 24

Hi. I’m completely new to WordPress, themes and especially child themes. It is very hard to understand where to begin, but I understand installing a child theme is generally recommended if one need to add code later. But I have more questions than answers. The child theme “tutorial” is not very useful for a beginner, like how do I install one? https://forum.tagdiv.com/the-child-theme-support-tutorial/ I’ve tried uploading it like I did with the “main” newspaper theme (newspaper.zip), but I don’t find a zip file named “childtheme.zip” or similar. I only find a folder named “Newspaper-child” with the files functions.php and styles inside. Do I upload theese files? I have a lot of beginner questions like: Can I still use one of the included demos to start? But I don’t find any help in the documentation. Tips where to start? Don’t want to install one of the demos in the “main” theme and start changing them before I understand how I can safely build the site without risking losing custom settings, content etc.

Post count: 20688

Hi,

@havardkrislok The child theme is useful if you want to modify theme files mainly, so if you plan to do that you can use it. The guide mentioned what files are supported to be modified in the child theme.
More information about child themes can always be found online
https://codex.wordpress.org/Child_Themes
http://www.wpbeginner.com/beginners-guide/wordpress-child-theme-pros-cons/
https://www.wordpressdepartment.com/wordpress-child-theme-pros-cons-wordpress-child-theme/

For CSS customization for example, there are custom code sections in the theme panel
https://www.screencast.com/t/1ION93IaM

The guide mentions where you can find the child theme
https://www.screencast.com/t/tuvJrGHeC7
This child theme has to be installed like any normal theme and activated. It is provided ready to be uploaded by FTP, if you want to install it with WordPress you must zip it first
https://www.screencast.com/t/UqeFIgH8s

For demos please check here
https://forum.tagdiv.com/demos_introduction/
https://forum.tagdiv.com/installing-demos/
These demos will install for the theme, in no relation to having a child theme or not. They can be uninstalled or switched at any time. If a demo is uninstalled the website will be as it was before installing it.

Let us know if you have further questions.

Thanks

Post count: 24

Thank you for your answer. I think I understand this a bit better now.

As I’m all new to this I don’t quite know yet if I will need to make .css changes or not. But I imagine it would be good to have the opportunity.

Is it possible to start using the normal theme, and then just add the child theme later if I need to make this kind of changes?

One other thing I don’t quite understand from the sources: How does the connection between the parent theme and the child theme work; how does the child theme “know” that the parent theme is updated? Are both themes active at the same time? So that you never really “update” the child theme, only the parent theme?

Some of the disadvantages mentioned in the articles include the time needed to learn the parent theme, and the importance of choosing a good parent theme. I guess this disadvantage and risk is eliminated by using the included parent theme?

Sorry if the answers to these questions are “obvious” for more experienced users. I get the impression that child themes are not really for beginners, but at the same time that they are something that is smart to use from the beginning:)

Post count: 20688

Hi,

There are settings for most things, so if a setting is created for a customization, there would be no need to make it custom. For creating CSS code there is a guide you can read
https://forum.tagdiv.com/create-custom-code-using-the-browsers-inspector/
This is useful when for example there is no setting for a modification you want to make, or the setting is general and you want something more specific.

I would mention that on contrary you should not worry yourself with the child theme from the beginning. Until you get more familiarized with the actual theme and it’s capabilities and structure there would be no reason to have one.
If in the future you should require one or we recommend you to create one for a specific reason, you can use it then.
Child themes require maintenance as well, so you will have to monitor theme updates and changelogs to keep it up to date.

Thanks

Viewing 6 posts - 1 through 6 (of 6 total)
The forum ‘Newspaper’ is closed to new topics and replies.