using file for snippets in functions.php

Community Forums Forums General Discussion using file for snippets in functions.php

This topic is: not resolved

This topic contains 2 replies, has 2 voices, and was last updated by  UT Mod 2 years ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #37352

    UT Mod

    Is it possible to put a snippet in file (something.php) and call it in functions.php on appropriate place?

    I mean, instead of pouring different codes for php in widget, adding fields in user bio, adding image sizes etc in functions.php, won’t it be a good idea to put all that in a seperate .php file and then call it in functions.php?

    If yes then how?



    Andrea Rennick

    It’s actually less efficient because there are more calls to separate files.

    And yes, you can do it with php includes. That’s not¬†WordPress specific, it’s just php.

    **forum signature**
    If you need technical support for your theme please file a ticket.

    The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.



    UT Mod

    Ok, so using this approach in functions.php or in Simple Hooks won’t be the best practice, right?

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.