Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #191043

    Hi
    we just realized (and checked thoroughly) that our childtheme does not call /config-templatebuilder/config.php

    We 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 check

    But nothing ever happened.

    Any idea how we can male our childtheme call the config.php our our custom-shortcode.php??
    regards axel

    #191090

    Hey 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,
    Devin

    #191130

    That’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örg

    #191155

    Hey!

    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!
    Devin

    #191441

    Hi
    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 672

    Can 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 196

    and 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.
    #191522

    You 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.

    #191577

    Hi 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 childtheme

    All the thing said in our last post is about this topic.

    #192190

    That 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.

    #192206
    This reply has been marked as private.
    #192247

    @ Devin
    Dont you think that a professional service should communicate that to potential buyers in advance??

    #192289

    Yes, 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.

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Child-theme does not call /config-templatebuilder/config.php’ is closed to new replies.