Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions.php is starting to get cluttered #2

Open
mike-source opened this issue Jul 10, 2015 · 0 comments
Open

Functions.php is starting to get cluttered #2

mike-source opened this issue Jul 10, 2015 · 0 comments

Comments

@mike-source
Copy link
Owner

I want functions.php itself to still be somewhere junior devs can copy/paste functions from google and have them work the way they're expecting. But I also want to separate out all of the reusable parts into a more logical structure.

So file structure would be: functions.php, in the root, and then a /functions/ directory, with files in that can be included.

e.g. functions.php:

    <?php

    include_once 'functions/theme-config.php';      // setup theme, thumbnail sizes, register nav menus, widgets etc.
    include_once 'functions/stylesheets.php';       // attach CSS
    include_once 'functions/js.php';                // attach JS
    include_once 'functions/shortcodes.php';        // theme specific shortcodes
    include_once 'functions/login.php';             // override login styling
    include_once 'functions/google-analytics.php';

    // Misc theme functions can be added after here:
@mike-source mike-source changed the title Functions.php is starting to get clutterred Functions.php is starting to get cluttered Jul 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant