Roots Discourse

Sage workflow

#1

Hello guys, first thx very much for this modern theme. i am working in my new theme and i have any qestions.

  • For each function for my theme i should create a plugin? example, i have a custom post. I should create a plugin fo this cpt function?

  • What file is the equivalent of function.php?

Thanks so much for reading :slight_smile:

0 Likes

#2

Equivalent files to functions.php are in your-theme/app: https://github.com/roots/sage/tree/master/app

This is the functions.php file: https://github.com/roots/sage/blob/master/resources/functions.php

These files are added to functions.php in this array: https://github.com/roots/sage/blob/master/resources/functions.php#L50-L61

Here is the info in the docs: https://roots.io/sage/docs/theme-functionality/

And the theme structure here: https://roots.io/sage/docs/theme-configuration-and-setup/

Greetings!

3 Likes

#3

We take a two-forked approach.

Information Architecture code — stuff that’s theme-independent like custom post types, custom taxonomies, image settings, etc — we put into a custom plugin and place it in mu-plugins.

Virtually all other functions go in the Sober Controller.

1 Like

closed #4

This topic was automatically closed after 42 days. New replies are no longer allowed.

0 Likes