'Where to insert php code into the functions.php file of my child theme

First of all, I'm not a developer. I've managed to insert some functions for my WooCommerce webshop by inserting code snippets into the functions.php file of my parent theme. I've made a child theme in case I have to update the theme. I'm afraid these functions get lost otherwise.

I've used the Child Theme Configurator plugin to create the child theme. Now I'm trying to insert the same code snippets into the functions.php file of the child theme. I however, break my site every time. Before adding the code I've removed the functions from the parent theme, otherwise an overlap might excist.

I think I'm adding these code snippets at the wrong location within the file. Below you see the code from the child theme:

<?php
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;

// BEGIN ENQUEUE PARENT ACTION
// AUTO GENERATED - Do not modify or remove comment markers above or below:

if ( !function_exists( 'chld_thm_cfg_locale_css' ) ):
    function chld_thm_cfg_locale_css( $uri ){
        if ( empty( $uri ) && is_rtl() && file_exists( get_template_directory() . '/rtl.css' ) )
            $uri = get_template_directory_uri() . '/rtl.css';
        return $uri;
    }
endif;
add_filter( 'locale_stylesheet_uri', 'chld_thm_cfg_locale_css' );
         
if ( !function_exists( 'child_theme_configurator_css' ) ):
    function child_theme_configurator_css() {
        wp_enqueue_style( 'chld_thm_cfg_child', trailingslashit( get_stylesheet_directory_uri() ) . 'style.css', array( 'hello-elementor','hello-elementor','hello-elementor-theme-style' ) );
    }
endif;
add_action( 'wp_enqueue_scripts', 'child_theme_configurator_css', 10 );

// END ENQUEUE PARENT ACTION

This is the code I've successfully added to the parent theme. Now I want to add it to the child theme:

        add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
       function woo_remove_product_tabs( $tabs ) {
           unset( $tabs['description'] );          // Remove the description tab
           unset( $tabs['additional_information'] );     // Remove the additional information tab
           return $tabs;
       }
       /* melding uitschakelen: toegevoegd aan winkelwagen */
        add_filter( 'wc_add_to_cart_message_html', 'ql_remove_add_to_cart_message' );
        function ql_remove_add_to_cart_message( $message ){
        return '';
        } 

Where and how do I add it?

Thanks for the help in advance! :)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source