Hi @alijafark, I’ll see to enable that in the next update for now. Try this:
add_filter( 'giveasap_display_template_path', 'change_path_to_template_in_child_theme'
then inside of that function:
function change_path_to_template_in_child_theme() {
return trailingslashit( get_stylesheet_directory() ) . 'giveasap/';
}
Then inside of giveasap folder add template1.php file
Also, I forgot I added this. You can create a folder giveaways and copy the structure there. For example, copy the giveasap_template.php and templates/template1.php and it should work out of the box
I’ve created a Folder In my child theme with the structure /giveaways/includes and added the file giveasap-template-functions.php and I also created another structure public/templates/template1.php In my giveaways Folder. it didn’t seem to override the Template. I also did restructure the path to templates/template1.php as you wrote it didn’t work either. and
dd_filter( 'giveasap_display_template_path', 'change_path_to_template_in_child_theme'
The First solution giveasap_display_template_path Didn’t work too
@alijafark inside of your child theme it should be giveaways/giveasap_template.php and giveaways/templates/template1.php
@ibenic Here is a screenshot of how I structured it as you explained. The Templates are not getting overridden.
Thank you.
You’re close 😀 Delete the other files as they won’t help you. Just leave the templates folder and the template1.php in it.
No create the giveasap_template.php file inside of /giveaways/ and then copy the contents of wp-plugins/giveasap/public/giveasap_template.php
You can delete the previous code involving giveasap_display_template_path.
Previous code has already been deleted those files are the files I’m trying to override I’ve deleted them too to test if giveasap_template.php works unfortunately there isn’t any success. Thanks
Hi @alijafark, I have tried it myself and everything seems to work.
Here is the structure of a child theme: https://paste.pics/84f0a5d325a89b7abbb94e6d441fde6b
(Both giveasap_template.php and template1.php have exact same code as the original ones).
And here if I change something inside of files in child theme, it reflects on the giveaway: https://paste.pics/72a69b52a18241605a0bae2849b65b4a
Doesn’t seem to work for me But Thank you @ibenic I’ll try figuring another way that works for me or why it isn’t. everything you said was done correctly on my side.
Thank you so much.
Hi any progress about this topic? I also tried but no luck.
https://paste.pics/BB4BY
https://paste.pics/BB4BF
https://paste.pics/BB4BO
-
This reply was modified 5 years, 3 months ago by
wadeshow25.