-
AuthorPosts
-
May 5, 2014 at 2:07 pm #260239
Hi all,
Question1:
Where can I download the latest child-theme setup? I checked the latest zip from themeforest but without any luck.Question2:
Previously I had a problem with a child-theme function, and this problem just came back on my new installation.
I really need to get this one fixed.What happens is this:
1. I have a childtheme working perfectly
2. I modify for instance the “shortcodes/masonry_entries.php
3. I add this code given to me by Dude to make sure that my modified version loads before the default: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; }
4. Result is, yes it does work! My modifications are shown. But it messes up all kinds of other things, in the wordpress backend there is header code loaded inside the body tag creating all kinds of problems, like dashboard items that are totally out of style, a strange margin at the top of the admin area, media manager doesnt show images anymore etc etc besides that the fullscreen slider on the frontend messes up etc etc.. something is going wrong here for sure, removing Dudes code from step 3 fixes everything again.
5. Any ideas here, I really need to be able to modify core files and not loose these modifications on updates.
Kind regards,
ThomasMay 5, 2014 at 4:28 pm #260330Hey borkent!
The latest child theme is available in the full download in your downloads on ThemeForest.
Any time you are replacing elements in a child theme you need to make sure that you keep your versions up to date with the changes in the parent. For instance we recently updated the header.php by moving all of the menu and layout logic to another file. The same goes for the shortcodes which are very often updated. So check the parent and make sure your changes are keeping up to date.
Cheers!
DevinMay 5, 2014 at 4:36 pm #260333Hi Devin,
I checked the latest zip from themeforest but without any luck.
There was no childtheme to be found inside the full zip with psd etc. Let me know if its hidden somewhere deep.. as I cant find it!
This is a new install and there are no outdated files, I am really looking for an answer as why this code gives me so many problems:
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; }
I changed 1 line in the file and need to have this file in my child theme so I can update, however I am still stuck on modifying the mommy theme.
Please let me know what my child themes functions.php needs to look like for it to overrule the shortcodes/masonry_entries.php
Cheers,
ThomasMay 5, 2014 at 5:18 pm #260350What I mean when I say compare is that you need to check if the file you are replacing has been updated. Re-copy it to your child theme and then make the change.
An updated child theme isn’t actually something you need to worry about in general since the child theme is a customized version for yourself.
The function you have now is the only way I know of to replace a parent shortcode file and if the change is causing you issues alone I can only guess that its the change itself: http://kriesi.at/documentation/enfold/add-new-or-replace-advanced-layout-builder-elements-from-child-theme/
May 5, 2014 at 6:33 pm #260403thx for you response!
Devin, tell me.. why does it mess up things even when I have the original file in my child-theme.
– copy over the untouched file from mommy theme to childtheme/shortcodes
– add the above code to childtheme/function.php
=> backend and frontend of the site get bugged out
-remove code form functions.php -> all fixed
=> modified core file works fine when kept in mommy theme folderThe type of changes I do to these files are so minor that it cant be my code or whatever.. its something else and I have encountered it twice now. I use a child theme to be able to update and keep going back to editing the mommy theme as this code breaks my site…
Greetings,
ThomasMay 5, 2014 at 7:32 pm #260430Do you have the shortcodes folder in place with the file inside of it? I’ve had the same function running on my dev install and child theme for at least a month. Peter and I also use it on multiple client sites for registering custom shortcode element and modifying them.
-
AuthorPosts
- You must be logged in to reply to this topic.