after I updated the yolo kidzone theme, the search function was visible again. At that time I had this function in the file function.php with the line
remove_filter ('wp_nav_menu_items', 'yolo_search_menu_item', 11, 2);
I have now provisionally copied the new functions.php file and pasted into the child theme and inserted the line at the end of the file.
Now my question: Was it correct to copy the complete file functions.php or would it be better that this file (in the child theme) had less content?
You don't need to copy the content of functions.php (parent theme) to functions.php (Child Theme).
Unlike style.css, the functions.php of a child theme does not override its counterpart from the parent. Instead, it is loaded in addition to the parent’s functions.php. (Specifically, it is loaded right before the parent’s file.)
That means that after each update of the theme I have to adjust the functions.php with my changes?
Let's say you've enabled child theme.
If you update your theme, it only affects the parent theme and doesn't affect your custom in Child Theme.
eg: You want to add a function AA. If you add it to the functions.php file of Parent theme -> This function will lose when you update the theme. If you add it to the functions.php file of Child theme => This function will normally work when you update the theme.
thanks for your help and the link.
You must be logged in and have valid license to reply to this topic.