Child theme and custom code

Posted in: Newspaper
Post count: 11

Hi everyone !

I’m using Newspaper theme for a client website.

For this specific website I wrote custom code into theme’s files for example in :

  • functions.php
  • header.php
  • Woocommerce templates

The problem I encounter right now is that when I upgrade Newspaper theme version, all custom codes I wrote on those files disapear.

I read the documentation about child theme so I just have this folder in my theme folder :

themes/Newspaper

Should I create a child folder like this : themes/Newspaper-child ?

What’s the best way to upgrade the theme and keep my custom code without deleting them ?

Thanks so much for your replies !

Post count: 18283

Hello !

Please make sure that you follow our guide as you can see here: https://forum.tagdiv.com/the-child-theme-support-tutorial/ All the files you want to “protect” from the update have to be inserted in the new child theme folder.

Thank you !

Post count: 11

Hi !

Weird thing but, I deleted my Newspaper/ theme folder and replaced it with Newspaper-child like the tutorial you sent me
I have this PHP error :

Use of undefined constant TDC_PATH_LEGACY – assumed ‘TDC_PATH_LEGACY’

Post count: 11

Also can you tell me why I’ve got this notice in my theme panel :

https://imgur.com/a/8RjWREw

I read your child theme support : https://forum.tagdiv.com/the-child-theme-support-tutorial/ … I’m confused now ..

Do I only need to create Newspaper-child/ folder in my theme folder ?
Or should I create Newspaper-child/ AND Newspaper/ in my theme folder ?

Thanks for your help !

  • This reply was modified 5 years by cbranquet.
Post count: 18283

Hello !

You don’t need to remove the parent folder. You must have both. The newspaper-child folder must be created in here: https://www.screencast.com/t/pGHdoUzoba

Thank you !

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