• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

using file for snippets in functions.php

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

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

This topic is: not resolved

Tagged: functions.php, snippets

  • This topic has 2 replies, 2 voices, and was last updated 12 years ago by vajrasar.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • April 24, 2013 at 5:32 am #37352
    vajrasar
    Member

    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?

    Thanks.


    I make WordPress websites using Genesis Framework.

    WordPress/Genesis Development | Customizations

    April 24, 2013 at 7:45 am #37376
    Andrea Rennick
    Member

    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.

    April 24, 2013 at 7:47 am #37379
    vajrasar
    Member

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


    I make WordPress websites using Genesis Framework.

    WordPress/Genesis Development | Customizations

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble