NooTheme Premium WordPress Theme › Forums › JobMonster › Override template files stored in “/framework/” folder via child theme
- This topic has 10 replies, 2 voices, and was last updated 1 year, 10 months ago by Jackie.
-
AuthorPosts
-
2 years ago #1219546
Hi codemaster,
I have been wondering whether it is possible to override "/framework/" template files via child theme.
Earlier I said to you. I use child theme to customize the theme and I have been doing that.
However, so far I have figured templates files which I can override via child theme are i"/layouts/' folder templates.So whatever changes I made under framework folder based on your advice has been done in the parent theme against my preference. I retain the original files though.
I always wanted to avoid toughing parent theme but there was no choice...
If possible, I want to override "/framework/" folder template files via child theme (same as /layout/ folder) as well.
Is there any piece of code I could put in functions.php (of the child theme) to make it happen?
2 years ago #1219565Hi.
Thank you for contacting us.
Please check this post: https://www.csestack.org/overwrite-wordpress-php-file-subfolder-child-theme/
Maybe that will help you overwrite the file in the theme parent.
Thanks.
2 years ago #1219597Thanks Jakie,
I employed the method you referred to.
For example the below file in the child theme folder was working fine./wp-content/themes/noo-jobmonster-child/framework/functions/noo-html-shortcodes.php
And to make it work, I put the following code in functions.php in the child theme.
require_once get_stylesheet_directory() .'/framework/functions/noo-html-shortcodes.php';
However as soon as I put following 2 files, fatal error occurred. Doesn't have to be 2 files. Even 1 file creates fatal error. You may think the files are wrong but don't get me wrong, this is without any modification. I just copied them from the parent theme and pasted them in child theme folder location for testing purposes.
/wp-content/themes/noo-jobmonster-child/framework/functions/noo-html.php
/wp-content/themes/noo-jobmonster-child/framework/functions/noo-utilities.phpIt would be great if you could look into it but I am guessing this is outside of your support scope...
2 years ago #1219599Summary
The following 3 files gave me a fatal error when located in child theme folder.
require_once get_stylesheet_directory() .'/framework/functions/noo-html.php';
require_once get_stylesheet_directory() .'/framework/functions/noo-utilities.php';
require_once get_stylesheet_directory() .'/framework/admin/visual-composer.php';On the other hand, the following 3 files work fine in child theme. No error.
require_once get_stylesheet_directory() .'/framework/functions/noo-html-shortcodes.php';
require_once get_stylesheet_directory() .'/framework/job/job-template.php';
require_once get_stylesheet_directory() .'/framework/job/job-expired.php';Some of the files were ones you applied the fix and advised me of the location of the modified files.
2 years ago #1219618Hi.
Maybe the file in the child theme also needs to require another function in another file. You also need to copy that file to the child theme.
Please give us the FTP account. We will help you check that.
Thanks.
1 year, 12 months ago #1219632This reply has been marked as private.1 year, 11 months ago #1219679Hi.
I have checked and helped you fix the issue when overwriting 3 files in the child theme.
Please recheck it.
Thanks.
1 year, 11 months ago #1219730Hi Jackie,
Thank you for your message.
My apologies for not responding sooner. I've been sick in bed.I got confused how codes inside few files are modified by you. Remember you are only accessing a test site. I have to apply the changes you made to my other site. And it is not just for this time but also I have to always consider about the future update when themeforest notifies us about the theme change (parent theme of course).
So I didn't expect you to modify the parent theme. You have changed few parent theme files correct?
(noo-html.php, noo-theme.php, noo-utilities.php) because only replacing child theme files gave me fatal errors again.My worry is when you update your themeforest noo-job theme, will you include these changes by default?
1 year, 11 months ago #1219744Hi.
The issue is from the parent theme, some functions will have the issue if you overwrite the child theme. So I need to change the file in the parent theme to avoid the issue when overwriting the file in the child theme.
We will update it to the parent theme in the next version.
Thanks.
1 year, 10 months ago #1219809Sorry for the late response. Been on leave. Thank you for your reply.
I understand your point but for now, I will leave the parent theme untouched
My main concern is when the parent theme has a future update, I lose track of what I modified.
1 year, 10 months ago #1219816Sorry, My modified code on your site is in the parent theme, I'll add it to the theme and release it on the new version. So if you have another modification, please add it to the child theme.
Thanks.
-
AuthorPosts
You must be logged in and have valid license to reply to this topic.