• Resolved beda69

    (@beda69)


    hello all

    I am building a custom theme and would like to know if there is any “should do” or WP Standards about which functions should come first in a functions.php file

    I am building a VERY minimalist theme, functions by now (and hopefully in future)
    are only a menu support, widget support, and bootstrap enqueuing

    nothing more

    Is there any rule to follow?
    or can i just add the functions as I like to ?

    (I ask this because it stood that i.e. CSS rules have a cascading behavior… last comes first)

    Thank you !!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    You should add your CSS to the style.css file and not the functions.php file.

    Thread Starter beda69

    (@beda69)

    Hello Andrew

    This is clear, i std enqueue, I enqueue the bootstrap libraries…


    function enqueue_my_scripts() {

    etc etc (i can’t post the entire function here…

    but as for the sequence, like should I first (on top of the functions.php) begin with the menu support, or with the style enqueue, or with a widget support..

    or isn’t there any rule at all?

    Thank you

    There’s no rule for this, and that’s because the timing of that is all controlled by your calls to add_action() and the action calls and weights that you give there. The order that you add these in your code is irrelevant.

    Thread Starter beda69

    (@beda69)

    OK I understand 🙂

    Thank you

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘general question about functions.php’ is closed to new replies.