Loading various PHP pages in a Child Theme help needed
-
Hello all!
I have a custom theme (Made from Industrial Themes on Themeforest) and in response to an issue the developer asked me to change some code in files for various featured sliders on the homepage.
My difficulty lies in the fact that I am using a Child Theme and while I’ve tested the changes with the parent and it works great, I don’t know how to make these changes within the construct of a child theme. To stress, I don’t know how, at all! I’ve researched as best I can and have come up short.
To be specific what I want to do is change a line of code in a file for a latest posts slider (inc/latest.php) from
<?php if($isreview && $rating_hide!="true") { ?>
to
<?php if($isreview) { ?>
What I am gathering so far is that just copying this file with the same directory path to the child theme and then editing it doesn’t work as it’s not a straightup template php file that automatically replaces the template php file in the parent. (At least it didn’t work for me.)
I am shooting in the dark to think that because this is more of a function type php file that it is being called somewhere and I have to find where and redirect the call to the child theme. My guess was all the files in the /inc folder were being called in a functions/custom.php file with this code
//function to get template parts function oswc_get_template_part($template_part) { do_action( 'oswc_get_template_part' ); if ( file_exists( TEMPLATEPATH . '/inc/' . $template_part . '.php') ) load_template( TEMPLATEPATH . '/inc/' . $template_part . '.php'); }
and I tried to alter it with STYLESHEETPATH and stylesheet replacements and put this file in the child theme too to no avail as I never see any changes at all in the site and don’t think anything is being loaded from the child theme. I could have messed up the code too, but I haven’t even made anything go wonky on the site or gotten errors to show me anything is being called at all.
I’ve got about 5 of these different files to alter with this code in the /inc folder and I am at a loss.
Helpsies? Thanks so much in advance!
This is my first time at something like this and any help is greatly appreciated!
- The topic ‘Loading various PHP pages in a Child Theme help needed’ is closed to new replies.