PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Custom Code "includes" outside Theme path

  1. I got tired of having to "rebuild" my functions.php (which I use extensively for Gravity forms, etc.) everytime I upgrade HeadwayTheme with the "one-click" upgrade (which I think is great, by the way) so I started keeping my custom code "outside" the headway theme path (in a folder called hw-custom) and then have a little script I run after upgrading to add the included two lines of code after the "Headway::Init()" line, currently number 20 into functions.php and thus including my custom code in the upgraded theme files.

    Could you perhaps make something similar a standard feature?

    /* Add my custom code */
    require_once get_theme_root() . '/hw-custom/functions.php';
    Posted 12 years ago on Tuesday October 9, 2012 | Permalink
  2. I've forwarded this on the the development team for them to review. Thanks a lot for the suggestion.

    Posted 12 years ago on Tuesday October 9, 2012 | Permalink
  3. During a quick chat with one of the other developers on the subject, this suggestion came up.. that the best thing to do in this situation is to house any custom code in your own custom plugin that you can then activate just like any other plugin. Then its completely separate from the user's theme and isn't impacted by theme updates, etc.

    Posted 12 years ago on Tuesday October 9, 2012 | Permalink