In my parent Theme I’ve a function without the initial statement:
if (!function_exists(... etc...
How can I replace it with a function with the same name in my child theme?
If I create the function into my functions.php it gives me an error due to the fact that there are two functions with the same name.
Thank you in advance for your answers.
This seems to be working for me:
Child theme function.php file is loaded before the parent theme functions file, therefore you shouldn’t get fatal error for re-declaring the function in the child theme. That’s why your parent theme is using the
function_exists
check.Maybe you’re declaring the function in the child theme after a hook(e.g. init)?
Here is the codex documentation about this: http://codex.wordpress.org/Child_Themes#Referencing_.2F_Including_Files_in_Your_Child_Theme
i think if you add same name of function then it take from child theme function then it take from parent.
For ex.
Child Theme
Parent Theme