• 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

Best approach

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 › Best approach

This topic is: not resolved
  • This topic has 2 replies, 3 voices, and was last updated 10 years, 3 months ago by krzywoo28.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • October 28, 2015 at 10:33 pm #169437
    Joan
    Member

    Wondering what's better:

    1. A conditional in functions.php to trigger a function (like is_page, is_home, is_whatever)...

    2. Or just put the function in the actual template file (page.php, home.php, page-id.php).

    I know it's going to work both ways, but I would like to know if there is any difference between them somehow, even for performance reasons.

    Since "functions.php" is always loaded, but the template only if it's required, wouldn't be better just writing the function on the actual template file?

    Thanks people! 🙂

    October 29, 2015 at 2:12 am #169440
    Davinder Singh Kainth
    Member

    If a trigger is to add widget on homepage, why put in functions.php file. Just add in front-page.php

    However, if trigger is to display widget on every page, add to functions.php

    Both methods work, however for home specific actions - using front-page.php makes more sense.


    Sunshine PRO genesis theme
    Need Genesis help? Davinder @ iGuiding Media | My Blog | Fresh Genesis Themes

    October 29, 2015 at 6:28 am #169459
    krzywoo28
    Member

    Sounds really great.

  • 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

© 2026 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