• 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

marcus

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
  • Profile
  • Topics Started
  • Replies Created
  • Engagements
  • Favorites

Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • September 14, 2014 at 5:54 am in reply to: template_redirect and switching templates dynamically #124317
    marcus
    Member

    We'd be happy to do it when time permits, not entirely yet sure whether to include it in the plugin, there are pros/cons but might make sense to do so.

    Thanks for the pointers!

    September 14, 2014 at 4:33 am in reply to: template_redirect and switching templates dynamically #124305
    marcus
    Member

    OK, an update.... this isn't possible the way I'd like to do it.

    What we're doing for normal themes is feeding the theme with the template file (even page.php) that has to be loaded and that file usually contains the HTML that is output.

    Genesis does it differently, calling the Genesis functions which then build the page according to WP_Query functions like is_single() which CPTs will always trigger as true.

    The only way to do this (and this is how Genesis WooCommere Connect does it) is load custom templates that fire/unload the right Genesis hooks to produce the right structure of page.

    So.... we'll need to warn users using Genesis that this function won't work as expected and that templates are needed. Maybe another plugin like GWC will be made in the future for Events Manager

    September 12, 2014 at 1:54 am in reply to: template_redirect and switching templates dynamically #124078
    marcus
    Member

    Thanks for the tip, but need to point out that this is somewhat off topic (esp for anyone else wanting to contribute here)... the checking of Genesis is fairly straightforward, my main concern is the switching of templates which is the part I'm having difficulties with.

    The Connect plugin was really helpful though, assuming it works I'll test it out and figure out why the same sort of snippet doesn't work for me.

    September 11, 2014 at 1:23 pm in reply to: template_redirect and switching templates dynamically #124004
    marcus
    Member

    If you look at the way Genesis checks for SEO plugins in genesis > lib > functions > seo.php you’ll see how its done.

    For this I assmue you're referring to checking if Genesis is active? I guess checking for a core function may be even better...

    Thanks for the Connect plugin reference, that's very handy. I had a go at copying what they do but it doesn't take (the hooks are fired and the right templates are passed on). I'll set up WC and this plugin to see it in action and will investigate further asap, if anyone has any suggestions meantime, much appreciated!

    
    add_action( 'after_setup_theme', 'em_genesis_single_template' );
    function em_genesis_single_template(){
    	if( get_option('dbem_cp_events_template') ){ //override default template
    		add_filter('template_include',array('EM_Event_Post','single_template'), 20); //function to do the overriding
    	}
    }
    
    September 10, 2014 at 11:17 am in reply to: template_redirect and switching templates dynamically #123769
    marcus
    Member

    Thanks for the reply. I could do that, I see there's some constants I could check for like PARENT_THEME_NAME == 'Genesis' (is that a good way?)

    The problem still remains that I don't know how to switch template files the genesis way even if I know Genesis is being used.

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)

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