• 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

Conditional 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 › Conditional in functions.php

This topic is: not resolved
  • This topic has 1 reply, 1 voice, and was last updated 9 years ago by JPJP9.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • May 21, 2017 at 7:51 pm #206817
    JPJP9
    Member

    Hi, I have 2 different sites that share 99% of their code but just need to accommodate a few separate functions and a touch of CSS for each.

    I was thinking I could set up a childtheme of the genesis childtheme for each but I don't think this works ie not possible.

    So if I have a conditional in the functions.php to enqueue a separate stylesheet or include a php file - that would work but what would the conditional test for:

    the site url? (and what would that conditional look like)
    or just test if a file exists and only include relevant files for each site.

    May 21, 2017 at 8:53 pm #206818
    JPJP9
    Member

    I have this working - sound OK?

    I have this function in functions.php

    $filename = get_stylesheet_directory()."/includes-tas/";
    if(file_exists($filename)) { 
            require_once( __DIR__ . '/includes-tas/tas.php');
    }

    Then tas.php includes an enqueue to a custom css file and specific functions to Tas website

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 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