Override parent theme

Posted in: Newspaper
Post count: 4

Hi,

I am currently trying to override few theme files, one of which is td_block.php(available in: includes>wp_booster>td_block.php).

I have added the file in my child theme in same path but it was giving me an error(Fatal error: Cannot redeclare class td_block) because there is no class_exists filter in the parent theme and WordPress was trying to declare a class which was already declared in the child theme. For now, I have added a class_exists filter in the parent theme and it’s working.

The issue is, though it is working now(because of the filter I added in the parent theme), it will break the moment we replace the parent theme with any update. can you help us how we can solve this issue in the long run?

Post count: 20688

Hi,

The file you mention is not supported to me modified in a child theme, only specific files from the booster folder can be modified in the child theme
https://forum.tagdiv.com/the-child-theme-support-tutorial/
You will have to make modifications directly in the main file and make a backup of it. Keep track of update change logs to see if this file is modified after an update. If not, restore the backup. That would be a solution.

Thanks

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