Home › Forums › WoodMart support forum › Child theme does not accept the code I edited
Child theme does not accept the code I edited
- This topic has 11 replies, 2 voices, and was last updated 1 month, 1 week ago by
Luke Nielsen.
-
AuthorPosts
-
June 4, 2025 at 5:24 am #665182
khangmarketer26-0714ParticipantI copied the folder path from the parent theme to the child theme, but when I edited the file in the child theme, it didn’t accept it. Please help me, how can I edit the code so that when I update the theme, it won’t be lost?
theme\woodmart\inc\integrations\woocommerce\template-tags.php
theme\woodmart-child\inc\integrations\woocommerce\template-tags.php
June 4, 2025 at 11:59 am #665269
Luke NielsenKeymasterHello,
Functions from template-tags.php you can override just via the functions.php file in your child theme.
E.g. – https://prnt.sc/P0IcbxokdPnx
Kind Regards
June 5, 2025 at 2:49 pm #665578
khangmarketer26-0714ParticipantIf I want to change the interface or change the location of a few places, how can I not change the interface again when I update the theme to the new version?
June 6, 2025 at 9:20 am #665695
Luke NielsenKeymasterHello,
All customizations that are in the Child theme will be saved after the update.
So if you override some theme’s functionality via the Child theme, you will not lose it after the update.
Kind Regards
June 6, 2025 at 9:26 am #665702
khangmarketer26-0714ParticipantBut the important thing is how can I change and save my structure on the child theme. For example, I want to change the structure of the payment page a little bit, move the discount code input box position down like this, then how can I change it, but when updating the parent theme, it will not lose my structure
June 6, 2025 at 11:52 am #665759
Luke NielsenKeymasterHello,
Check the article below for help:
https://www.businessbloomer.com/woocommerce-move-remove-coupon-form-cart-checkout/
Define the code in the functions.php file in your child theme.
Kind Regards
June 6, 2025 at 11:55 am #665765
khangmarketer26-0714ParticipantYes. Thanks for the information. However, what if I want to edit the interface anywhere else?
June 6, 2025 at 12:20 pm #665771
Luke NielsenKeymasterSome things you can edit via the Layouts builder – https://xtemos.com/docs-topic/woodmart-woocommerce-layout-builder/
Also, you can copy this
woocommerce/checkout/form-checkout.php
file with its path via Child theme and make some changes there.Kind Regards
June 6, 2025 at 12:32 pm #665774
khangmarketer26-0714ParticipantI copied from
theme\woodmart\inc\integrations\woocommerce\template-tags.php
to
theme\woodmart-child\inc\integrations\woocommerce\template-tags.php
I edited the code at theme\woodmart-child\inc\integrations\woocommerce\template-tags.php it did not overwrite my code
June 6, 2025 at 3:05 pm #665835
Luke NielsenKeymasterHello,
The template-tags.php file cannot be overridden via Child theme, there are a lot of functions that can be overridden, just copy the function with the hook and paste it into the functions.php file of the Child theme.
Clarify what exactly you are trying to change there, in the template-tags.php
Kind Regards
June 6, 2025 at 6:17 pm #665902
khangmarketer26-0714ParticipantI want to edit
<div class=”wd-product-cats<?php echo woodmart_get_old_classes( ‘ woodmart-product-cats’ ); ?>”>
<?php echo implode( ‘, ‘, $links ); // phpcs:ignore ?>
</div>To
<div class=”wd-product-cats<?php echo woodmart_get_old_classes( ‘ woodmart-product-cats’ ); ?>”>
<?php
if (!empty($links)) {
echo end($links); // Only show the last link (deepest category)
}
?>
</div>So how is the funcion code?
June 9, 2025 at 9:09 am #666078
Luke NielsenKeymasterHello,
Copy this https://prnt.sc/nbgm0cbG7jho function in the red line to the functions.php file in your child theme, make the necessary changes and check how it works.
Kind Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register