December 3, 2014 at 6:03 pm #31718
I would love to know if there is a way that i can override the parent functions.php file in a child theme.
I have installed the Dokan plugin and the theme too, but i would love to override some of the functionalities in the functions.php file, I don't won't to do that in the parent file in order to get all the updates and all the new features.
And can you tell me what are the required files that i have to put in my child theme in order to make it work properly.
For example, the file that I want to override is the template-tags.php file, this file is being called from the functions.php file, and there are more stuff that I want to customize too.
Thanks.December 3, 2014 at 7:07 pm #31721
In your child theme you have to maintain the file order of the main theme. You can use any file which you want to customize but you have to maintain the same file order as main theme. Hope you got it.
Thank you 🙂December 3, 2014 at 8:51 pm #31730
I'm doing that but it's not working, i have figure out why but i can't fix it.
The file that i'm talking about is beeing called from the parent function.php file, so it always loading the parent file, when i do the same in my child theme, i'm getting a duplication error…can you help ?December 4, 2014 at 1:30 pm #31800
Sekander BadshaMemberPost count: 2067
Can you please tell us exactly which function you want to override?
It would be easy for us to instruct you can be more specific.December 9, 2014 at 5:42 pm #32046
Basically what I’m trying to do is the following:
the dokan theme has a top right menu which in it we have the sign up button and the and login and the cart if you are not signed in, so let’s call that the top menu…. What I want to do is bring that menu from the top and include it in to my main menu, so I will have my menu and the dokan theme user menu as one.
in order to do this I have located where the code is and included it to my menu, the function was dokan_header_user_menu(), so I want to remove the ‘ul' tags from this menu in order to style the menu properly, and have more control on how it’s going to behave.
I don’t want to chage the main dokan theme files cuz it have a lot of features that I want to use, so I wanna know if there is a way that I can override the template-tags.php file, which has the dokan_header_user_menu() function.
thanksDecember 10, 2014 at 11:07 am #32073
Please follow the following instruction-
1. Copy header.php file from the parent theme and paste it to your child theme.
2. You have to copy this function
dokan_header_user_menu()to child themes function.php and change the name of this function name as you want. You can do whatever you want to do with this function.
3. Now you have to open your child theme's header.php file then you have to replace this function
dokan_header_user_menu()to your new function which you have changed in function.php.
Please check and let me know. Thank you 🙂December 12, 2014 at 7:45 pm #32212
thanks a lot, it works.December 12, 2014 at 7:47 pm #32213
Very glad to know that. If you have no more problem then please mark this topic as resolved.
Thank you 🙂
The topic ‘Overriding the functions.php parent file in a child theme’ is closed to new replies.