-
AuthorPosts
-
November 20, 2013 at 5:53 pm #191043
Hi
we just realized (and checked thoroughly) that our childtheme does not call /config-templatebuilder/config.phpWe just want to call a own shortcode which is located in custom-shortcode.php
We did in our childtheme:
-create config.php
-created the herarchy /config-templatebuilder/
-created the hierarchy /config-templatebuilder/avia-shortcodes/custom-shortcode.php
-we echoed a “Hallo welt” in our custom-shortcode.php just to checkBut nothing ever happened.
Any idea how we can male our childtheme call the config.php our our custom-shortcode.php??
regards axelNovember 20, 2013 at 7:08 pm #191090Hey kaMai!
Child themes do not work like that. They only replace what is in the root folder of the child theme and for the functions it gets added in addition to the parent functions.php.
You would need to add a new function to include the files in your child theme since there is nothing telling the parent or child that you have files somewhere else.
See: https://kriesi.at/support/topic/portfolio-meta/#post-134009
Regards,
DevinNovember 20, 2013 at 8:57 pm #191130That’s not right, Devin. The content of a child theme will always be first loaded, if it’s in the same directory structure as the parent. If I’d like to have a custom category view on Enfold, a copy of functions/loop-single.php within the child will do the trick quite nice.
As for the framework-specific stuff it get’s more complicated, because the developer needs to know where and when files are included. This is the hard stuff where “regular” people will get stuck. Thous, this can be handled the same way, if you copy over the file which is including the other (or calling the function).
Frequently asked as example:
Enabling the post type or other post types so they may use the layout builder. This needs to be done in the parent (meta.php) and get’s lost, if the theme is updated. So copying this file won’t do the trick, because meta.php is included elsewhere. Applying the filter within the child functions.php also won’t work, because it is overwriten from the parent (and the inclusion of a different file afterwards).If I set a stop point in eclipse, the array from the child functions.php is substituted. On a later point it get’s overwritten by the include.
So if I move on to the template-builder.class.php where the meta.php is included around line 409 within the function apply_editor_wrap. If I copy over this file to my child, the meta.php from my child will be loaded.
I don’t need to tell that this is a rookie way – developers would/may e. g. refactor the function – otherwise if you like to have a lot of customisation you are forced to include around 50% of the Enfold framework… bad idea. ;)
Just to let you know.
Regards,
JörgNovember 20, 2013 at 10:14 pm #191155Hey!
The theme uses get_template_part for the includes which is why they will be included when you add them in with the same structure. The same file is in the same location in the child theme so it gets loaded first.
It doesn’t work like that in all instances and so I generally explain it like I did above. The function I linked to will tell the theme to look for shortcode files in a new shortcode folder and then add them in as needed.
Cheers!
DevinNovember 21, 2013 at 2:40 pm #191441Hi
thanx for you help.
We followed your advices and did:
1: we noted require_once( ‘config-templatebuilder/avia-template-builder/php/template-builder.class.php’); in the functions.php of our childtheme and got this error:
Fatal error: Call to undefined function av_icon_css_string() in /usr/www/users/axella/wordpress/wp-content/themes/enfold/css/dynamic-css.php on line 672Can you please tell us how to solve that?
regards axel
PS: we tried also to do this:
require_once( ‘config-templatebuilder/avia-template-builder/config/meta.php’
But this threw out this error:
Fatal error: Class ‘AviaHelper’ not found in /usr/www/users/axella/wordpress/wp-content/themes/enfold-child/config-templatebuilder/avia-template-builder/config/meta.php on line 196and a warning:
Notice: Use of undefined constant THEMENAME – assumed ‘THEMENAME’ in /usr/www/users/axella/wordpress/wp-content/themes/enfold-child/config-templatebuilder/avia-template-builder/config/meta.php on line 178
- This reply was modified 11 years, 1 month ago by kaMai.
November 21, 2013 at 5:44 pm #191522You need to use this function here: https://kriesi.at/support/topic/portfolio-meta/#post-134009
That will let you have your own shortcodes folder in your child theme.
November 21, 2013 at 7:31 pm #191577Hi Devin,
we already did that and it works.But i am not talking about shortcodes.
We are talking about making the Advanced layout builder work in custom page types.
Therefore we need to call the meta.php in our childthemeAll the thing said in our last post is about this topic.
November 23, 2013 at 2:48 am #192190That is *not* something we can support at the moment since the advanced layout builder is not yet designed to work on other custom post types without issue.
However, the most straightforward and easiest option is to just change that in the parent. We don’t have anything in place to easily hook into the function to add in the template builder to other post types from a child because it isn’t supported yet.
November 23, 2013 at 5:42 am #192206This reply has been marked as private.November 23, 2013 at 2:02 pm #192247@ Devin
Dont you think that a professional service should communicate that to potential buyers in advance??November 23, 2013 at 6:10 pm #192289Yes, I do and the fact that it is not a feature is the standard for communicating that. Its the same reason that all of the browsers the theme supports is listed on Themeforest and all of the plugins that have specific support are listed as well.
Features that are supported expressly are shown on the themes page so buyers can understand what they are purchasing beforehand. Those items that are not featured are not listed.
Child themes, while powerful, are not the best solution if you are doing heavy customization to a theme. What I would suggest you do is keep a change log for your install of those changes and code you have modified in the parent’s framework. That way, updating the theme is pretty straightforward unless a file is completely removed from one version to the next.
-
AuthorPosts
- The topic ‘Child-theme does not call /config-templatebuilder/config.php’ is closed to new replies.