Tagged: child theme, customization, overwritten
-
AuthorPosts
-
August 31, 2014 at 12:17 pm #311502
Hello Support,
I have created a couple of customizations in loop-index.php and postslider.php to show my custom fields. Following the advice of support I have created a child theme and took the latest version of the theme as parent… I’ve redone the modifications on the latest theme files and saved them in a same name directory in the child theme folder.
Somehow the parent files are not overwritten by the child theme. What am I doing wrong? Please see this image where I show the differences.
https://imageshack.com/i/ipXnuWSwp
I’ve set back the site to my modified theme. If you would like to see it live in action, please let me know, I will enable the child theme.
Thanks in advance!
- This topic was modified 10 years, 3 months ago by originaltours. Reason: Image link added
September 1, 2014 at 5:08 am #311652Hey originaltours!
Thank you for using Enfold.
If you want to edit the shortcodes like postslider.php, add this code on the child theme’s functions.php:
add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1); function avia_include_shortcode_template($paths) { $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; }
Create a folder called “shortcodes” then place the postslider.php there.
Best regards,
IsmaelSeptember 1, 2014 at 10:19 am #311720Thanks, does this work the same for loop-index.php?
And other files I’d like to customize?Thanks in advance for your superior support!
September 2, 2014 at 3:13 pm #312330Hi!
The loop-index file should be replaced automatically as long as its the same name and in the same folder in your child theme. Its being called by the get_template_part function which is already child theme friendly for *I think* every instance in the parent.
Regards,
DevinSeptember 2, 2014 at 3:18 pm #312333Thanks for that, Devin…
Although I’m a little confused right now. For the postslider.php file I have to create a function in functions.php and for loop-index.php not. So which files should be called via functions.php and which not?
I’m requesting this as my nl_NL.mo file in the folder lang of the child theme is not overwriting the nl_NL.mo file of the parent… I’m wondering how I should get this to work.
Thanks in advance!
September 2, 2014 at 3:32 pm #312343WordPress has a number of functions that determine what will be used in a child theme instead of the parent. Anything that is called using the get_template_part function from a theme file for instance will look for the file being requested in the child theme first.
For the ALB elements (postslider.php) you need to use a function to tell Enfold that the child theme has a folder to check before looking in the parent since WordPress alone doesn’t know about the themes custom stuff.
For the translation file it looks like you need to add the file in your child theme root directory and then tell WordPress about it via a function: http://codex.wordpress.org/Function_Reference/load_child_theme_textdomain
September 2, 2014 at 3:39 pm #312349Thanks, that explains it all! I’ll look into the translation file.
Ticket can be closed.
Thumbs up!
September 2, 2014 at 3:54 pm #312356Glad we could help :)
January 10, 2017 at 11:21 am #731504Thanks, topic can be closed
January 11, 2017 at 6:10 am #731861 -
AuthorPosts
- The topic ‘Theme customizations not shown with Child theme’ is closed to new replies.